From 61a21771f4d6c2ba1842d866b4895e7f366a461a Mon Sep 17 00:00:00 2001 From: Janin-Michel-Mathias Date: Thu, 29 Aug 2024 15:29:17 +0200 Subject: [PATCH] set publish on release --- ...de-change.yml => on-code-change-merge.yml} | 24 ++++++------------- .github/workflows/on-release.yml | 20 ++++++++++++++++ 2 files changed, 27 insertions(+), 17 deletions(-) rename .github/workflows/{on-code-change.yml => on-code-change-merge.yml} (56%) create mode 100644 .github/workflows/on-release.yml diff --git a/.github/workflows/on-code-change.yml b/.github/workflows/on-code-change-merge.yml similarity index 56% rename from .github/workflows/on-code-change.yml rename to .github/workflows/on-code-change-merge.yml index 463f035..8013790 100644 --- a/.github/workflows/on-code-change.yml +++ b/.github/workflows/on-code-change-merge.yml @@ -1,6 +1,10 @@ -name: On code change +name: On code change & merge -on: [push, pull_request] +on: + pull_request: + push: + branches: + - master jobs: build: @@ -30,18 +34,4 @@ jobs: run: | yarn install yarn test - publish: - name: Publish to npm - runs-on: ubuntu-latest - needs: test - - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '10.x' - - name: Publish to npm - run: | - yarn install - echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc - yarn publish --access public + diff --git a/.github/workflows/on-release.yml b/.github/workflows/on-release.yml new file mode 100644 index 0000000..b5b6c66 --- /dev/null +++ b/.github/workflows/on-release.yml @@ -0,0 +1,20 @@ +name: On release +on: + release: + types: [published] + +jobs: + publish: + name: Publish to npm + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '10.x' + - name: Publish to npm + run: | + yarn install + echo "//registry.npmjs.org/:_authToken=${{ secrets.NPMJS_PUBLISH_TOKEN }}" > .npmrc + yarn publish --access public \ No newline at end of file