Skip to content

Commit

Permalink
fix: do not commit version.h to main for release please (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
xeekworx authored Nov 25, 2024
1 parent 820c02a commit 9017f34
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
release:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
releases_created: ${{ steps.release.outputs.releases_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- name: Checkout
Expand All @@ -33,19 +33,23 @@ jobs:
- name: Generate & Commit Version Header
if: ${{ steps.release.outputs.releases_created }}
run: |
# Generate the version header file
echo "// Do not modify this file, it is overwritten by release-please.yml!" > ${{ env.VER_FILE }}
echo "#pragma once" >> ${{ env.VER_FILE }}
echo "constexpr const wchar_t APP_VERSION[] = L\"${{ steps.release.outputs.tag_name }}\"" >> ${{ env.VER_FILE }}
echo "constexpr const wchar_t APP_VERSION[] = L\"${{ steps.release.outputs.tag_name }}\";" >> ${{ env.VER_FILE }}
# Commit & push the changes to the release branch
RELEASE_BRANCH=$(git rev-parse --abbrev-ref HEAD)
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add ${{ env.VER_FILE }}
git add ${{ env.VER_FILE }}
git commit -m "chore: update version header to ${{ steps.release.outputs.tag_name }}"
git push
git push origin $RELEASE_BRANCH
build-x64:
name: Build x64 Release
needs: release
if: ${{ needs.release.outputs.release_created }}
if: ${{ needs.release.outputs.releases_created }}
uses: ./.github/workflows/build.yml
secrets: inherit
with:
Expand All @@ -55,7 +59,7 @@ jobs:
build-x86:
name: Build x86 Release
needs: release
if: ${{ needs.release.outputs.release_created }}
if: ${{ needs.release.outputs.releases_created }}
uses: ./.github/workflows/build.yml
secrets: inherit
with:
Expand All @@ -66,7 +70,7 @@ jobs:
name: Publish Release
runs-on: ubuntu-latest
needs: [release,build-x64, build-x86]
if: ${{ needs.release.outputs.release_created }}
if: ${{ needs.release.outputs.releases_created }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down

0 comments on commit 9017f34

Please sign in to comment.