From 63081ebf5bf0ec2f2506391d58477d118585c149 Mon Sep 17 00:00:00 2001 From: Julien Ganichot Date: Wed, 15 Nov 2023 11:35:43 +0100 Subject: [PATCH] fix: tryfix --- .github/workflows/test.yaml | 24 ++++++++++++++++++++++++ action.yml | 2 +- bootstrap.mjs | 13 +++++++++++++ scripts/install-dependencies.sh | 2 +- 4 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test.yaml create mode 100644 bootstrap.mjs diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 000000000..0a3e35079 --- /dev/null +++ b/.github/workflows/test.yaml @@ -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 diff --git a/action.yml b/action.yml index b147a2792..9e543a33a 100644 --- a/action.yml +++ b/action.yml @@ -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 diff --git a/bootstrap.mjs b/bootstrap.mjs new file mode 100644 index 000000000..b29ba663f --- /dev/null +++ b/bootstrap.mjs @@ -0,0 +1,13 @@ +import { execSync } from 'child_process'; + +try { + const __dirname = new URL('.', import.meta.url).pathname; + execSync('npm ci --omit=dev --no-audit --no-progress --prefer-offline', { + stdio: 'inherit', + cwd: __dirname, + }); + + await import('./dist/index.js'); +} catch (err) { + console.log(err); +} diff --git a/scripts/install-dependencies.sh b/scripts/install-dependencies.sh index dacf6ab62..5b6bb07df 100755 --- a/scripts/install-dependencies.sh +++ b/scripts/install-dependencies.sh @@ -2,7 +2,7 @@ set -ex -npm --prefix "$1" ci "$1" --only=production --no-audit --no-progress --prefer-offline +npm --prefix "$1" ci "$1" --omit=dev --no-audit --no-progress --prefer-offline if [ "$#" -gt 1 ]; then # Install additional packages.