refactor: rename release.yaml to publish.yaml #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: "On Merge to main branch: release new version" | |
concurrency: | |
group: main-release-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get Latest Tag | |
id: latest-tag | |
run: echo "tag=$(git tag -l | sort -V | tail -1 | sed 's/-dev$//')" >> "$GITHUB_OUTPUT" | |
- name: Generate New Bumped Version | |
uses: actions-ecosystem/action-bump-semver@v1 | |
id: bump-semver | |
with: | |
current_version: ${{ steps.latest-tag.outputs.tag }} | |
level: patch | |
- name: Create Release Notes | |
id: create-release | |
run: | | |
curl -f -X POST \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
-H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/${{ github.repository }}/releases \ | |
-d '{"tag_name":"${{ steps.bump-semver.outputs.new_version }}", "generate_release_notes":true}' |