mirror of
https://github.com/h-sphere/sql-seal.git
synced 2026-07-22 10:10:28 +00:00
fix: include release version in PR title and commit name (#204)
This commit is contained in:
parent
bf085fe896
commit
f57e0f5a00
1 changed files with 12 additions and 5 deletions
17
.github/workflows/release.yml
vendored
17
.github/workflows/release.yml
vendored
|
|
@ -23,19 +23,26 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 18.x
|
||||||
cache: "pnpm"
|
cache: "pnpm"
|
||||||
- name: Get current version
|
|
||||||
id: get-version
|
|
||||||
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
|
|
||||||
- run: pnpm install --frozen-lockfile
|
- run: pnpm install --frozen-lockfile
|
||||||
- run: pnpm build
|
- run: pnpm build
|
||||||
|
- name: Get release version
|
||||||
|
id: get-version
|
||||||
|
run: |
|
||||||
|
# If changesets are pending, get the next bumped version from them.
|
||||||
|
# If no changesets (publish run), the release PR already bumped package.json.
|
||||||
|
if pnpm changeset status --output=.changeset/status.json 2>/dev/null; then
|
||||||
|
NEXT=$(node -e "try { const s = require('./.changeset/status.json'); console.log(s.releases[0].newVersion) } catch(e) { console.log('') }")
|
||||||
|
fi
|
||||||
|
CURRENT=$(node -p "require('./package.json').version")
|
||||||
|
echo "version=${NEXT:-$CURRENT}" >> $GITHUB_OUTPUT
|
||||||
- name: Create Release Pull Request or Publish
|
- name: Create Release Pull Request or Publish
|
||||||
id: changesets
|
id: changesets
|
||||||
uses: changesets/action@v1
|
uses: changesets/action@v1
|
||||||
with:
|
with:
|
||||||
publish: pnpm run ci:publish
|
publish: pnpm run ci:publish
|
||||||
version: pnpm run ci:version
|
version: pnpm run ci:version
|
||||||
title: "[Release] ${{ steps.changesets.outputs.version || 'Next' }}"
|
title: "release: Release ${{ steps.get-version.outputs.version }}"
|
||||||
commit: "release: Release ${{ steps.changesets.outputs.version || 'Next' }}"
|
commit: "release: Release ${{ steps.get-version.outputs.version }}"
|
||||||
createGithubReleases: false # this is handled inside ci:publish script
|
createGithubReleases: false # this is handled inside ci:publish script
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
Loading…
Reference in a new issue