From 101925f2b5d36cfc08085ad911a1df7437ed2573 Mon Sep 17 00:00:00 2001 From: weboko Date: Fri, 6 Jan 2023 00:29:06 +0100 Subject: [PATCH 1/5] add release stage --- .github/workflows/ci.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b5edd1..44f33fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,3 +44,26 @@ jobs: node-version: ${{ env.NODE_JS }} - uses: bahmutov/npm-install@v1 - run: npm run test:browser + + release_next: + runs-on: ubuntu-latest + needs: [check, build, browser] + steps: + - uses: actions/checkout@v2.3.3 + - uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_JS }} + - uses: bahmutov/npm-install@v1 + + - name: Append git hash to version + shell: bash + run: | + CURR_VERSION=$(cat package.json | jq .version | tr -d '"') + GIT_HASH=$(git rev-parse --short HEAD) + cat package.json| jq --arg version "$CURR_VERSION-$GIT_HASH" '.version |= $version' > _package.json + mv -f _package.json package.json + + - name: Authenticate with registry + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ./.npmrc + + - run: npm publish --tag next --access public From e5c48051611d477a6a8bf6f00e34b7a2fa112d88 Mon Sep 17 00:00:00 2001 From: weboko Date: Fri, 6 Jan 2023 00:48:03 +0100 Subject: [PATCH 2/5] run only on master --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44f33fa..bb087f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,6 +48,7 @@ jobs: release_next: runs-on: ubuntu-latest needs: [check, build, browser] + if: github.event_name == 'push' && github.ref == 'refs/heads/master' steps: - uses: actions/checkout@v2.3.3 - uses: actions/setup-node@v3 From f905b3836272c86c4085e31d30b7d40a8b7a91a3 Mon Sep 17 00:00:00 2001 From: weboko Date: Wed, 25 Jan 2023 01:03:01 +0100 Subject: [PATCH 3/5] try to run publish: --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb087f8..44f33fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,6 @@ jobs: release_next: runs-on: ubuntu-latest needs: [check, build, browser] - if: github.event_name == 'push' && github.ref == 'refs/heads/master' steps: - uses: actions/checkout@v2.3.3 - uses: actions/setup-node@v3 From b6ad57b38a4220253eb93085842a12781306ce32 Mon Sep 17 00:00:00 2001 From: weboko Date: Wed, 25 Jan 2023 01:05:40 +0100 Subject: [PATCH 4/5] fix lint error --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44f33fa..5a5208f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: node-version: ${{ env.NODE_JS }} - uses: bahmutov/npm-install@v1 - run: npm run test:browser - + release_next: runs-on: ubuntu-latest needs: [check, build, browser] From 60183ba97d54158ba0adb3627f6d4ee14df9e1fa Mon Sep 17 00:00:00 2001 From: weboko Date: Wed, 25 Jan 2023 01:16:07 +0100 Subject: [PATCH 5/5] enable publishing only on master --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a5208f..7e1ea64 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,6 +48,7 @@ jobs: release_next: runs-on: ubuntu-latest needs: [check, build, browser] + if: github.event_name == 'push' && github.ref == 'refs/heads/master' steps: - uses: actions/checkout@v2.3.3 - uses: actions/setup-node@v3