From 274dd170c9ccddff3fda7954b61cf7fed06036f1 Mon Sep 17 00:00:00 2001 From: rinrub <99617143+rinrub@users.noreply.github.com> Date: Mon, 26 Aug 2024 09:57:20 +0200 Subject: [PATCH] actions scritps --- .github/workflows/build.yml | 4 +-- .github/workflows/prerelease.yml | 34 +++++++++++++++++++ .../{npm-publish.yml => release.yml} | 4 +-- 3 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/prerelease.yml rename .github/workflows/{npm-publish.yml => release.yml} (96%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 05e070ff..4c57b26f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - node-version: [12.x, 14.x, 16.x, 18.x] + node-version: [16.x, 18.x, 20.x] # See supported Node.js release, schedule at https://nodejs.org/en/about/releases/ steps: @@ -26,6 +26,6 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: 'npm' - - run: npm ci + - run: npm install - run: npm run build:js --if-present - run: npm test diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml new file mode 100644 index 00000000..a6360d1c --- /dev/null +++ b/.github/workflows/prerelease.yml @@ -0,0 +1,34 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages + +name: Prerelease + +on: + release: + types: [prereleased] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + - run: npm ci + - run: npm test + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm run prepare + - run: cd ./lib && npm publish --tag beta + env: + NODE_AUTH_TOKEN: ${{secrets.PUBLISH_HELSENORGE_PACKAGES_TO_NPMJS}} diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/release.yml similarity index 96% rename from .github/workflows/npm-publish.yml rename to .github/workflows/release.yml index 5010d56d..f91656bd 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/release.yml @@ -1,11 +1,11 @@ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages -name: Publish +name: Release on: release: - types: [created] + types: [released] jobs: build: