-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (45 loc) · 1.39 KB
/
semantic-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
name: Semantic Release
run-name: Semantic Release from ${{ github.ref_name }}
on:
push:
branches:
- '**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
semantic:
name: Determine version
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@v4
with:
fetch-depth: 0
- name: Semantic release
id: release
uses: cycjimmy/semantic-release-action@v4
with:
dry_run: true
release:
name: Release version
runs-on: ubuntu-latest
timeout-minutes: 30
needs: semantic
if: needs.semantic.outputs.new_release_published == 'true' && needs.semantic.outputs.new_release_version != '1.0.0'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Release version ${{ needs.semantic.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 }}