-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
2 changed files
with
37 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
# Get the new version number from the tag | ||
NEW_VERSION=$(echo $GITHUB_REF | cut -d / -f 3) | ||
|
||
# Remove the 'v' prefix if present | ||
NEW_VERSION=${NEW_VERSION#v} | ||
|
||
# Update the version in main.php | ||
sed -i "s/Version: [0-9.]\+/Version: $NEW_VERSION/" main.php | ||
|
||
# Commit the change | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add main.php | ||
git commit -m "Bump version to $NEW_VERSION" | ||
|
||
# Push the change | ||
git push |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Update Version | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
update-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Update version in main.php | ||
run: | | ||
chmod +x .github/scripts/update-version.sh | ||
.github/scripts/update-version.sh |