From 463907115e794ca11d5f0d3f9982c5a6cac69871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Teles?= Date: Sat, 18 May 2024 07:29:55 -0300 Subject: [PATCH] chore: Update GitHub Actions workflow for releasing and publishing package --- .github/workflows/publish.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 64b0b83..ad88613 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -30,20 +30,25 @@ jobs: # - name: Run tests # run: npm test - - name: Bump version and create tag + - name: Bump version id: bump_version run: | - NEW_TAG=$(npx standard-version --dry-run | grep "tagging release" | awk '{print $3}') - echo "NEW_TAG=$NEW_TAG" >> $GITHUB_ENV + # Incrementa a versão usando standard-version + npx standard-version --release-as patch + # Obter nova versão + NEW_VERSION=$(node -p "require('./package.json').version") + echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV + # Adiciona commit e tag + git push --follow-tags origin main - name: Create GitHub release id: create_release uses: actions/create-release@v1 with: - tag_name: ${{ env.NEW_TAG }} - release_name: Release ${{ env.NEW_TAG }} + tag_name: "v${{ env.NEW_VERSION }}" + release_name: Release ${{ env.NEW_VERSION }} body: | - Release notes for ${{ env.NEW_TAG }} + Release notes for ${{ env.NEW_VERSION }} draft: false prerelease: false env: