forked from coenjacobs/mozart
-
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (36 loc) · 1.17 KB
/
updateversionfromchangelog.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
# When a new version number is added to the changelog, update the bin.
name: Update version from changelog
on:
push:
branches:
- master
paths:
- "CHANGELOG.md"
jobs:
update-version:
name: "Create Strauss phar on new release"
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
with:
ref: master
- name: "Update version number in `bin/strauss`"
run: |
CURRENT_RELEASE="$(sed -n -e '0,/^## \([0-9.]\+\).*$/ s//\1/p' CHANGELOG.md)"
test -n "${CURRENT_RELEASE}"
sed -i -e "s/^}, '[0-9.]\\+');\$/}, '${CURRENT_RELEASE}');/" bin/strauss
- name: "Commit `bin/strauss` changes"
run: |
if git diff --quiet; then
echo "No changes."
exit 0
fi
git config user.name "${{ github.actor }}"
# https://api.github.com/users/github-actions%5Bbot%5D
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -- bin/strauss
git commit -m "🤖 Update version number in bin"
git push