diff --git a/.changeset/config.json b/.changeset/config.json index 9d317a4b..8ffedc22 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -7,7 +7,7 @@ } ], "commit": false, - "linked": [], + "fixed": [["@promster/*"]], "access": "restricted", "baseBranch": "main" } diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5ceff991..eaf2dd04 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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/* @@ -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 }} diff --git a/scripts/print-release-version.sh b/scripts/print-release-version.sh new file mode 100755 index 00000000..90fad306 --- /dev/null +++ b/scripts/print-release-version.sh @@ -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"