Merge branch 'main' of https://github.com/envoy/webflow-website #2
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: Auto Increment Version | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
create-tag: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Read the current version and increment | |
run: | | |
echo "OLD_VERSION=$(cat .version)" >> $GITHUB_ENV | |
NEW_VERSION=$(( $(cat .version) + 1 )) | |
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV | |
echo $NEW_VERSION > .version | |
- name: Commit and Tag New Version | |
run: | | |
git config --global user.name 'GitHub Action' | |
git config --global user.email '[email protected]' | |
git add .version | |
git commit -m "Increment version to ${{ env.NEW_VERSION }}" | |
git tag ${{ env.NEW_VERSION }} | |
git push --follow-tags |