forked from coenjacobs/mozart
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
63f56a7
commit 2286cee
Showing
1 changed file
with
19 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,27 +7,33 @@ on: | |
branches: | ||
- master | ||
paths: | ||
- 'CHANGELOG.md' | ||
- "CHANGELOG.md" | ||
|
||
|
||
jobs: | ||
update-version: | ||
name: "Create Strauss phar on new release" | ||
runs-on: ubuntu-latest | ||
name: Create Strauss phar on new release | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v2 | ||
- name: "Checkout repository" | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: master | ||
|
||
- name: "Edit `strauss/bin/strauss` to update the version number" | ||
- name: "Update version number in `bin/strauss`" | ||
run: | | ||
CURRENT_RELEASE=$(cat CHANGELOG.md | grep --max-count=1 -o '##.*' | awk '{print $2}') | ||
find bin -name 'strauss' -exec sed -i "s/}, '[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*');/}, '$CURRENT_RELEASE');/" {} + | ||
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 updated README.md | ||
uses: stefanzweifel/[email protected] | ||
with: | ||
branch: master | ||
file_pattern: "bin/strauss" | ||
commit_message: "🤖 Update version number in bin" | ||
- name: "Commit `bin/strauss` changes" | ||
run: | | ||
if git diff --quiet; then | ||
echo "No changes." | ||
exit 0 | ||
fi | ||
git add -- bin/strauss | ||
git commit -m "🤖 Update version number in bin" | ||
git push |