From b01c360c5126c01214930222cadd630d25235097 Mon Sep 17 00:00:00 2001 From: ashleigh Date: Tue, 18 Mar 2025 08:47:36 +0000 Subject: [PATCH 1/2] feat: added release method for npm publish on github release --- .github/workflows/release.yml | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a6d29cd --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,52 @@ +name: Release + +on: + release: + types: [published] + +env: + NPM_TOKEN: ${{secrets.NPM_TOKEN}} + +permissions: + contents: read + id-token: write + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Get Tag + uses: olegtarasov/get-tag@v2.1 + id: tagName + with: + tagRegex: '(?.*)' + - name: Set Node + uses: actions/setup-node@v3 + with: + node-version: '18.x' + + - name: Install + run: yarn + + - name: Build + run: | + yarn build + + - name: Package Version Bump + run: | + yarn version ${{ steps.tagName.outputs.version }} + + - name: Commit + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: 'chore: bump version' + branch: master + + - name: Publish + run: | + yarn publish --tag latest From 372e3f4e185e3cf6ab8f06bd47412965ceb0bc66 Mon Sep 17 00:00:00 2001 From: ashleigh Date: Tue, 18 Mar 2025 08:54:03 +0000 Subject: [PATCH 2/2] refactor: changed tag version method --- .github/workflows/release.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a6d29cd..a8409a4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,11 +20,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Get Tag - uses: olegtarasov/get-tag@v2.1 - id: tagName - with: - tagRegex: '(?.*)' + - name: Set Node uses: actions/setup-node@v3 with: @@ -39,12 +35,12 @@ jobs: - name: Package Version Bump run: | - yarn version ${{ steps.tagName.outputs.version }} + yarn version ${{ github.event.release.tag_name }} - name: Commit uses: stefanzweifel/git-auto-commit-action@v4 with: - commit_message: 'chore: bump version' + commit_message: 'chore: bump version ${{ github.event.release.tag_name }}' branch: master - name: Publish