-
Notifications
You must be signed in to change notification settings - Fork 8
51 lines (41 loc) · 1.35 KB
/
update-helics.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Update HELICS Version
on:
workflow_dispatch:
inputs:
version:
description: 'HELICS version number (without leading `v` prefix)'
required: true
type: string
dryrun:
description: 'Do a dry run of the update process, without making the commit'
required: false
type: boolean
jobs:
update-helics-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set git config for commits
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Update HELICS version number
run: |
# Update lines in the package file
version_line="__version__ = \"v${{ inputs.version }}\""
echo "::group::__version__ line"
echo "$version_line"
echo "::endgroup::"
sed -i "/__version__ =/c ${version_line}" helics/_version.py
git add helics/_version.py
echo "::group::git diff --staged"
git diff --staged
echo "::endgroup::"
git commit -m "build(release): Bump to v${{ inputs.version }}"
echo "::group::git show"
git show
echo "::endgroup::"
if [ "${{ inputs.dryrun }}" = "false" ]; then
echo "Pushing changes"
git push
fi