v2.0.0-alpha.14 #7
Workflow file for this run
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
name: Update Version on Release | |
on: | |
release: | |
types: [published] | |
jobs: | |
update-version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: master | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
- name: Get latest release tag | |
run: echo "RELEASE_VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV | |
- name: Log current version | |
run: cat config/app.php | grep version | |
- name: Update version in config/app.php | |
run: | | |
sed -i "s/'version' => env('APP_VERSION', '[^']*'/'version' => env('APP_VERSION', '${RELEASE_VERSION}'/" config/app.php | |
echo "Updated config/app.php with version: ${RELEASE_VERSION}" | |
cat config/app.php | grep version | |
- name: Commit and push changes | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add config/app.php | |
git commit -m "Update app version to ${RELEASE_VERSION}" || echo "No changes to commit" | |
git push origin master |