Skip to content

Commit

Permalink
fix: runtime bootstrap for import of semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
Ganitzsh committed Nov 15, 2023
1 parent 918cfa6 commit f56d9e9
Show file tree
Hide file tree
Showing 23 changed files with 310 additions and 731 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ jobs:
node-version-file: '.nvmrc'
registry-url: 'https://npm.pkg.github.com'
- name: Install dependencies
env:
GITHUB_EVENT_NAME: push
run: npm ci --ignore-scripts --no-audit --no-progress --prefer-offline
- name: Test
run: npm run test:ci
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test

on:
workflow_dispatch:

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: 'npm'
node-version-file: '.nvmrc'
registry-url: 'https://npm.pkg.github.com'
- name: Release
uses: './'
with:
node-module: true
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ outputs:
Released version in format of X.Y.Z (major.minor.patch-prerelease+build).
name: Release me!
runs:
main: dist/index.js
main: bootstrap.mjs
using: node20
20 changes: 20 additions & 0 deletions bootstrap.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import * as url from 'url';
import { execSync } from 'child_process';

const __dirname = url.fileURLToPath(new URL('.', import.meta.url));

const actionRoot = __dirname;

execSync(
`npm --prefix ${actionRoot} install semantic-release --omit=dev --no-audit --no-progress --prefer-offline`,
{
stdio: 'inherit',
cwd: actionRoot,
env: {
...process.env,
PWD: actionRoot,
},
},
);

await import('./dist/index.js');
2 changes: 1 addition & 1 deletion dist/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/release.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/utilities/error.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/utilities/generatePlugins.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 0 additions & 35 deletions dist/utilities/git.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/utilities/git.d.ts.map

This file was deleted.

2 changes: 1 addition & 1 deletion dist/utilities/inputProcessors.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/utilities/installDependencies.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/utilities/outputParsers.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/utilities/parseConfiguration.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/utilities/transform.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file added git
Empty file.
Loading

0 comments on commit f56d9e9

Please sign in to comment.