Merge pull request #25 from reload/dependabot/github_actions/anothrNi… #11
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: | |
push: | |
branches: main | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Bump version and push tag | |
uses: anothrNick/github-tag-action@1.71.0 | |
id: version | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} | |
WITH_V: true | |
DEFAULT_BUMP: patch | |
- name: Major version tag | |
id: major-version | |
if: ${{ (steps.version.outputs.new_tag != '') }} | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
core.setOutput('tag', '${{ steps.version.outputs.new_tag }}'.split('.')[0]) | |
- name: Tag major version ${{ steps.major-version.outputs.tag }} | |
if: ${{ (steps.version.outputs.new_tag != '') }} | |
run: | | |
git tag --force ${{ steps.major-version.outputs.tag }} | |
git push origin ${{ steps.major-version.outputs.tag }} --force | |
- name: Create/update major version release | |
if: ${{ (steps.version.outputs.new_tag != '') }} | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.PAT_TOKEN }} | |
allowUpdates: true | |
generateReleaseNotes: true | |
tag: ${{ steps.major-version.outputs.tag }} | |
name: ${{ steps.major-version.outputs.tag }} (${{ steps.version.outputs.new_tag }}) | |
- name: Create release ${{ steps.version.outputs.new_tag }} | |
if: ${{ (steps.version.outputs.new_tag != '') }} | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.PAT_TOKEN }} | |
generateReleaseNotes: true | |
tag: ${{ steps.version.outputs.new_tag }} | |
name: Release ${{ steps.version.outputs.new_tag }} |