Skip to content

Commit

Permalink
refactor: to use aggregate release using changesets (#1124)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdeekens authored Oct 10, 2023
1 parent eab1f5c commit b9c703a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
}
],
"commit": false,
"linked": [],
"fixed": [["@promster/*"]],
"access": "restricted",
"baseBranch": "main"
}
12 changes: 11 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ jobs:
ref: main
fetch-depth: 50

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

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

Expand Down Expand Up @@ -59,11 +66,14 @@ jobs:

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1.4.5
uses: dotansimha/changesets-action@v1.5.2
with:
title: 'ci(changesets): version packages'
commit: 'ci(changesets): version packages'
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 }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
12 changes: 12 additions & 0 deletions scripts/print-release-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -e

# Running "changeset version" to know the new release version
pnpm changeset version &>/dev/null

release_version=$(node -e "console.log(require('./packages/metrics/package.json').version)")

git reset --hard &>/dev/null

echo "$release_version"

0 comments on commit b9c703a

Please sign in to comment.