Merge pull request #3 from alhankeser/feature/releases #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: Release Latest Version | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Bump version and push tag | |
id: tag_version | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Release new version | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ steps.tag_version.outputs.new_tag }} | |
name: ${{ steps.tag_version.outputs.new_tag }} | |
body: ${{ steps.tag_version.outputs.changelog }} | |
- name: Get major version | |
id: major_version | |
run: | | |
echo "major_version=$(echo ${{ steps.tag_version.outputs.new_tag }} | cut -d. -f1)" >> $GITHUB_OUTPUT | |
- name: Retag | |
run: | | |
git tag -f latest || true | |
git tag -f ${{ steps.major_version.outputs.major_version }} || true | |
git push -f --tags || true |