From d4f5b21a62345ca7211e83ab981cced4d9ac8ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20=27birdy=27=20Danjou?= Date: Wed, 7 Feb 2024 17:59:54 +0100 Subject: [PATCH] chore: update prerelease and release workflow --- .github/workflows/publish.yml | 2 +- .github/workflows/publishprerelease.yml | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publishprerelease.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 399db8e..cc727ae 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,6 +1,6 @@ on: release: - types: [created] + types: [released] jobs: publish: diff --git a/.github/workflows/publishprerelease.yml b/.github/workflows/publishprerelease.yml new file mode 100644 index 0000000..182d085 --- /dev/null +++ b/.github/workflows/publishprerelease.yml @@ -0,0 +1,20 @@ +on: + release: + types: [prereleased] + +jobs: + publish: + if: github.event_name == 'release' && github.event.action == 'published' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18.x + - run: npm ci + - run: npm test + - run: npm run build + - uses: JS-DevTools/npm-publish@0f451a94170d1699fd50710966d48fb26194d939 + with: + tag: prerelease + token: ${{ secrets.NPM_TOKEN }}