diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 80e1e55b..fc4e6f12 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -69,6 +69,12 @@ jobs: run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} + - name: Create git tag + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git tag "v${{ steps.bump.outputs.version }}" + git push origin "v${{ steps.bump.outputs.version }}" # Build the site for embed view and other demo build-site: diff --git a/scripts/bump-version.js b/scripts/bump-version.js index b2c4eece..8165328b 100755 --- a/scripts/bump-version.js +++ b/scripts/bump-version.js @@ -102,13 +102,9 @@ const run = async () => { JSON.stringify(pkg, null, 2) + "\n", ); - // Create git tag - execSync(`git tag v${newVersion}`); - console.log(`\nCreated git tag: v${newVersion}`); - // Set output for GitHub Actions if (process.env.GITHUB_ACTIONS) { - fs.appendFileSync(process.env.GITHUB_OUTPUT, `version=v${newVersion}\n`); + fs.appendFileSync(process.env.GITHUB_OUTPUT, `version=${newVersion}\n`); } } else { console.log("\nDRY RUN: No changes were made");