From ae653b28a2a198af4269ff7ff928b2b8ae304824 Mon Sep 17 00:00:00 2001 From: Mario Arnautou Date: Wed, 17 Jan 2024 11:38:26 +0100 Subject: [PATCH] ci: automatically tag --- .github/workflows/publish.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8e51c3d..8c39333 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -35,7 +35,8 @@ jobs: runs-on: ubuntu-latest needs: run_tests outputs: - is_bumped: ${{ steps.npm_check.outputs.changes }} + is_bumped: ${{ steps.npm_check.outputs.bump }} + npm_target_version: ${{ steps.npm_check.outputs.target_version }} steps: - name: Checkout uses: actions/checkout@v4 @@ -49,7 +50,8 @@ jobs: run: | manifest=$(jq -r '.version' ./npm/robespierre/package.json) npm=$(npm view robespierre --json | jq -r '.version') - [[ "$manifest" == "$npm" ]] && echo "false" >> "$GITHUB_OUTPUT" || echo "true" >> "$GITHUB_OUTPUT" + [[ "$manifest" == "$npm" ]] && echo "bump=false" >> "$GITHUB_OUTPUT" || echo "bump=true" >> "$GITHUB_OUTPUT" + echo "target_version=$(jq -r '.version' ./npm/robespierre/package.json)" >> "$GITHUB_OUTPUT" publish-npm-binaries: name: Publish NPM packages @@ -151,3 +153,9 @@ jobs: npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - uses: actions-ecosystem/action-push-tag@v1 + env: + TARGET_VERSION: ${{needs.need_publish.outputs.npm_target_version}} + name: Push tag + with: + tag: $TARGET_VERSION