Skip to content

Commit

Permalink
Bugfix/ci release (#14)
Browse files Browse the repository at this point in the history
* ci: fix token permissions for build workflow

* ci: change method of version commit
  • Loading branch information
piotrmacha authored May 19, 2024
1 parent 7691668 commit 3d62f93
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
ssh-key: ${{ secrets.NEKOBOCIK_SSH_KEY }}
submodules: recursive
- uses: TheMrMilchmann/setup-msvc-dev@v3
with:
Expand All @@ -52,19 +50,32 @@ jobs:
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 3d62f93

Please sign in to comment.