From 0d197a0d1db8629df4a15554c8bbbc33d64250e6 Mon Sep 17 00:00:00 2001 From: Don McCurdy Date: Wed, 2 Oct 2024 11:36:54 -0400 Subject: [PATCH] bump --- .github/workflows/release.yml | 5 ++++- scripts/postversion-commit.js | 14 ++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3a33284..5db2d80 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,12 +20,15 @@ jobs: # - https://stackoverflow.com/a/33733020 - name: Read git tag id: git-tag - run: echo "TAG_NAME=$(git tag --points-at HEAD)" >> $GITHUB_OUTPUT + run: | + echo "TAG_NAME=$(git tag --points-at HEAD)" >> $GITHUB_OUTPUT + echo "TEST=TESTTESTTEST" >> $GITHUB_OUTPUT # TODO: TESTING - name: Test git tag env: GIT_TAG: ${{ steps.git-tag.outputs.TAG_NAME }} + TEST: ${{ steps.git-tag.outputs.TEST }} if: contains(env.GIT_TAG, 'v') == false run: echo "Missing GIT_TAG; aborting" && exit 1 diff --git a/scripts/postversion-commit.js b/scripts/postversion-commit.js index 25bcf0e..d66cb7d 100644 --- a/scripts/postversion-commit.js +++ b/scripts/postversion-commit.js @@ -1,19 +1,17 @@ import {execSync} from 'node:child_process'; -import pkg from '../package.json' assert {type: 'json'}; /** * Utility for committing and tagging a release commit in * git, called as part of the `yarn postversion` script. */ -const currentBranch = execSync('git rev-parse --abbrev-ref HEAD') - .toString() - .trim(); +const branch = execSync('git rev-parse --abbrev-ref HEAD').toString().trim(); +const {version} = require('../package.json'); -if (currentBranch === 'main') { - execSync(`git checkout -b 'release/${pkg.version}'`); +if (branch === 'main') { + execSync(`git checkout -b 'release/${version}'`); } execSync('git add -u'); -execSync(`git commit -m 'chore(release): ${pkg.version}'`); -execSync(`git tag -a ${pkg.version} -m ${pkg.version}`); +execSync(`git commit -m 'chore(release): ${version}'`); +execSync(`git tag -a ${version} -m ${version}`);