Skip to content

Commit

Permalink
fix: release version script
Browse files Browse the repository at this point in the history
  • Loading branch information
tdeekens committed Oct 10, 2023
1 parent 610180d commit eb8d1eb
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 15 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ jobs:

- name: Storing release version for changeset
id: release_version
run: echo "VALUE=$(./scripts/print-release-version.sh)" >> $GITHUB_OUTPUT
run: ./scripts/echo-release-version.sh
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Ouptut release version
run: echo "The release version is ${{ steps.release_version.outputs.RELEASE_VERSION }}"

- name: Fetch all tags (for releases)
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

Expand Down Expand Up @@ -73,7 +76,7 @@ jobs:
publish: pnpm changeset publish
version: pnpm changeset:version-and-format
createGithubReleases: aggregate
githubReleaseName: v${{ steps.release_version.outputs.value }}
githubTagName: v${{ steps.release_version.outputs.value }}
githubReleaseName: v${{ steps.release_version.outputs.RELEASE_VERSION }}
githubTagName: v${{ steps.release_version.outputs.RELEASE_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
25 changes: 25 additions & 0 deletions scripts/echo-release-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

set -e

echo "Running 'changeset version' to know the new release version"

yarn changeset version &>/dev/null

echo "Running 'git status' to see the worktree changes"

git status

echo "Determining the version from the package.json of a package"
release_version=$(node -e "console.log(require('./packages/metrics/package.json').version)")

echo "Version for release is $release_version"

echo "Running 'git reset' and exporting to GITHUB_OUTPUT"

git reset --hard &>/dev/null

echo "RELEASE_VERSION=$release_version" >> $GITHUB_OUTPUT

echo "GITHUB_OUTPUT is:"
echo $GITHUB_OUTPUT
12 changes: 0 additions & 12 deletions scripts/print-release-version.sh

This file was deleted.

0 comments on commit eb8d1eb

Please sign in to comment.