Skip to content

Commit 1205da1

Browse files
committed
fix: do not commit version.h to main for release please
1 parent 820c02a commit 1205da1

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

.github/workflows/release-please.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
release:
1818
runs-on: ubuntu-latest
1919
outputs:
20-
release_created: ${{ steps.release.outputs.release_created }}
20+
releases_created: ${{ steps.release.outputs.releases_created }}
2121
tag_name: ${{ steps.release.outputs.tag_name }}
2222
steps:
2323
- name: Checkout
@@ -33,19 +33,23 @@ jobs:
3333
- name: Generate & Commit Version Header
3434
if: ${{ steps.release.outputs.releases_created }}
3535
run: |
36+
# Generate the version header file
3637
echo "// Do not modify this file, it is overwritten by release-please.yml!" > ${{ env.VER_FILE }}
3738
echo "#pragma once" >> ${{ env.VER_FILE }}
38-
echo "constexpr const wchar_t APP_VERSION[] = L\"${{ steps.release.outputs.tag_name }}\"" >> ${{ env.VER_FILE }}
39+
echo "constexpr const wchar_t APP_VERSION[] = L\"${{ steps.release.outputs.tag_name }}\";" >> ${{ env.VER_FILE }}
40+
41+
# Commit & push the changes to the release branch
42+
RELEASE_BRANCH=$(git rev-parse --abbrev-ref HEAD)
3943
git config user.name "github-actions[bot]"
4044
git config user.email "github-actions[bot]@users.noreply.github.com"
41-
git add ${{ env.VER_FILE }}
45+
git add ${{ env.VER_FILE }}
4246
git commit -m "chore: update version header to ${{ steps.release.outputs.tag_name }}"
43-
git push
47+
git push origin $RELEASE_BRANCH
4448
4549
build-x64:
4650
name: Build x64 Release
4751
needs: release
48-
if: ${{ needs.release.outputs.release_created }}
52+
if: ${{ needs.release.outputs.releases_created }}
4953
uses: ./.github/workflows/build.yml
5054
secrets: inherit
5155
with:
@@ -55,7 +59,7 @@ jobs:
5559
build-x86:
5660
name: Build x86 Release
5761
needs: release
58-
if: ${{ needs.release.outputs.release_created }}
62+
if: ${{ needs.release.outputs.releases_created }}
5963
uses: ./.github/workflows/build.yml
6064
secrets: inherit
6165
with:
@@ -66,7 +70,7 @@ jobs:
6670
name: Publish Release
6771
runs-on: ubuntu-latest
6872
needs: [release,build-x64, build-x86]
69-
if: ${{ needs.release.outputs.release_created }}
73+
if: ${{ needs.release.outputs.releases_created }}
7074
steps:
7175
- name: Checkout code
7276
uses: actions/checkout@v4

0 commit comments

Comments
 (0)