1.1.7 #9
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: Release | |
on: | |
release: | |
types: [ released ] | |
jobs: | |
release: | |
name: Bump version & push tags | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Prepare new version number helper | |
run: | | |
export TAG_NAME=${{ github.event.release.tag_name }} | |
echo "NEW_VERSION=${TAG_NAME:1:${#TAG_NAME}}" >> $GITHUB_ENV | |
- name: Configure Git | |
run: | | |
git config user.email "[email protected]" | |
git config user.name $GITHUB_ACTOR | |
- name: Delete existing tag | |
run: git tag -d "v$NEW_VERSION" | |
- name: Bump the version | |
run: yarn version --new-version $NEW_VERSION --message "Bump version to %s" | |
- name: Push to master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: git push --force "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY" "HEAD:master" | |
- name: Push the new tag | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: git push --force "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY" "HEAD:$GITHUB_REF" | |
- name: Push the major & minor tag | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git push --force "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY" "HEAD:refs/tags/v${NEW_VERSION%.*}" | |
git push --force "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY" "HEAD:refs/tags/v${NEW_VERSION%.*.*}" |