-
Notifications
You must be signed in to change notification settings - Fork 58
56 lines (46 loc) · 1.28 KB
/
release.yml
File metadata and controls
56 lines (46 loc) · 1.28 KB
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
50
51
52
53
54
55
56
name: Release
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
permissions:
contents: write
id-token: write
jobs:
check-release:
runs-on: ubuntu-latest
outputs:
should_release: ${{ steps.check.outputs.should_release }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: 'main'
- name: Check if release needed
id: check
run: |
if npx --yes should-semantic-release; then
echo "should_release=true" >> $GITHUB_OUTPUT
else
echo "should_release=false" >> $GITHUB_OUTPUT
fi
release:
runs-on: ubuntu-latest
needs: check-release
if: needs.check-release.outputs.should_release == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: 'main'
- name: Git config
run: |
git config user.name "github-actions"
git config user.email "github-actions@users.noreply.github.com"
- name: Release
run: npx --yes -p release-it -p @release-it/conventional-changelog release-it
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}