Skip to content

Commit f29faab

Browse files
committed
fix: update version in package.yaml before building
This gets compiled in and used for `--version`.
1 parent 8459193 commit f29faab

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/release.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,28 @@ jobs:
2424

2525
steps:
2626
- uses: actions/checkout@v4
27+
28+
# Use dry-run to get computed release
29+
- id: release
30+
uses: cycjimmy/semantic-release-action@v4
31+
with:
32+
dry_run: true
33+
extra_plugins: |
34+
conventional-changelog-conventionalcommits
35+
env:
36+
FORCE_COLOR: 1
37+
GITHUB_TOKEN: ${{ github.token }}
38+
39+
# update version in package.yaml, so the --version option works correctly
40+
- run: |
41+
new_version=$EPOCH.$MAJOR.$MINOR.$PATCH
42+
yq -i ".version = \"$new_version\"" package.yaml
43+
env:
44+
EPOCH: 0
45+
MAJOR: ${{ steps.release.outputs.new_release_major_version }}
46+
MINOR: ${{ steps.release.outputs.new_release_minor_version }}
47+
PATCH: ${{ steps.release.outputs.new_release_patch_version }}
48+
2749
- id: stack
2850
uses: freckle/stack-action@v5
2951
- uses: extractions/setup-just@v2
@@ -76,6 +98,7 @@ jobs:
7698
steps:
7799
- uses: actions/checkout@v4
78100
- run: ./install -t '${{ needs.release.outputs.tag }}'
101+
- run: restyle --version
79102
- run: restyle --help
80103

81104
docs:

0 commit comments

Comments
 (0)