Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
donmccurdy committed Oct 2, 2024
1 parent 93c894f commit 0d197a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 6 additions & 8 deletions scripts/postversion-commit.js
Original file line number Diff line number Diff line change
@@ -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}`);

0 comments on commit 0d197a0

Please sign in to comment.