Skip to content

Commit

Permalink
ci: change method of version commit
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmacha committed May 19, 2024
1 parent 12e4c20 commit 529cfd3
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,39 @@ jobs:
name: MSVC / Windows 2022
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
ssh-key: ${{ secrets.NEKOBOCIK_SSH_KEY }}
submodules: recursive
- uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x86
toolset: ${{ inputs.msvc-toolkit }}
export-path-to-vcvarsall: VCVARSALL
- name: CMake Setup
uses: lukka/get-cmake@latest
- uses: actions/checkout@v4
with:
submodules: recursive
persist-credentials: false
- name: Set project version
if: ${{ inputs.project-version != 'false' }}
run: powershell ./set-version.ps1 ${{ inputs.project-version }}
- uses: stefanzweifel/git-auto-commit-action@v5
- name: Setup token for branch rules bypass
uses: webfactory/[email protected]
if: ${{ inputs.push-version-commit == true }}
with:
branch: ${{ inputs.push-version-branch }}
commit_options: --no-verify --signoff
file_pattern: CMakeLists.txt
commit_user_name: Nekobocik
status_options: --untracked-files=no
commit_message: '[skip ci] set project version to ${{ inputs.project-version }}'
push_options: --force
ssh-private-key: ${{ secrets.NEKOBOCIK_SSH_KEY }}
- name: Commit version change
if: ${{ inputs.push-version-commit == true }}
shell: bash
run: |
git config --global user.name "Nekobot"
git fetch --all
git checkout ${{ inputs.push-version-branch }}
if [ -z "$(git status -s)" ]; then
echo "No changes to commit"
else
git add CMakeLists.txt
git commit -m "[skip ci] set project version to ${{ inputs.project-version }}"
git push -u origin ${{ inputs.push-version-branch }}
fi
- name: CMake Configure
run: cmake --preset ${{ inputs.cmake-preset }}
- name: Ninja Build
Expand Down

0 comments on commit 529cfd3

Please sign in to comment.