diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 76b0656..801b5aa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,15 +10,23 @@ jobs: create-tag: runs-on: ubuntu-latest outputs: - new_tag: ${{ steps.tag_version.outputs.new_tag }} - new_version: ${{ steps.tag_version.outputs.new_version }} + new_tag: ${{ steps.get_version.outputs.new_tag }} + new_version: ${{ steps.get_version.outputs.new_version }} steps: - uses: actions/checkout@v4 - - name: Bump version and push tag - id: tag_version - uses: mathieudutour/github-tag-action@v6.2 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Get version from package.json + id: get_version + run: | + VERSION=$(node -p "require('./package.json').version") + echo "new_version=$VERSION" >> $GITHUB_OUTPUT + echo "new_tag=v$VERSION" >> $GITHUB_OUTPUT + + - name: Create and push tag + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git tag -a "v${{ steps.get_version.outputs.new_version }}" -m "Release v${{ steps.get_version.outputs.new_version }}" || echo "Tag already exists" + git push origin "v${{ steps.get_version.outputs.new_version }}" || echo "Tag already pushed" build-and-release: needs: create-tag