Semantic Release from main #34
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: Semantic Release | |
run-name: Semantic Release from ${{ github.ref_name }} | |
on: | |
push: | |
branches: | |
- 'main' | |
- 'next' | |
- 'next-major' | |
- 'beta' | |
- 'alpha' | |
- '*.x' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
semantic: | |
name: Release | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
outputs: | |
new_release_published: ${{ steps.release.outputs.new_release_published }} | |
new_release_version: ${{ steps.release.outputs.new_release_version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Semantic release | |
id: release | |
uses: cycjimmy/semantic-release-action@v3 | |
with: | |
semantic_version: '^19.0.0' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
release: | |
name: Release version | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
needs: semantic | |
if: ${{ needs.semantic.outputs.new_release_published == 'true' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Release version ${{ steps.release.outputs.new_release_version }} on ${{ github.ref_name }} | |
run: gh workflow run version.yml --raw-field version=$VERSION --ref $BRANCH | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
VERSION: ${{ needs.semantic.outputs.new_release_version }} | |
BRANCH: ${{ github.ref_name }} |