-
-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (70 loc) · 2.1 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Release
on:
push:
branches:
- "main"
concurrency:
group: larastrict-release-${{ github.ref }}
cancel-in-progress: true
jobs:
commits:
name: Check commits
secrets: inherit
uses: ./.github/workflows/commits.yml
check:
name: Check code
secrets: inherit
uses: ./.github/workflows/check-code.yml
deploy:
needs:
- check
name: Create release if changelog has changes
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Bump version and push tag
uses: anothrNick/[email protected]
id: version
env:
DEFAULT_BUMP: patch
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
INITIAL_VERSION: 0.0.1
TAG_CONTEXT: branch
- name: Try to update CHANGELOG
id: changelog
uses: Requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ steps.version.outputs.new_tag }}
- name: Create Release
if: steps.changelog.outputs.changes != ''
uses: ncipollo/release-action@v1
with:
allowUpdates: true
draft: false
body: ${{ steps.changelog.outputs.changes }}
token: ${{ github.token }}
name: ${{ steps.version.outputs.new_tag }}
tag: ${{ steps.version.outputs.new_tag }}
- name: Commit CHANGELOG.md
if: steps.changelog.outputs.changes != ''
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]'
file_pattern: CHANGELOG.md
- name: Remove tag
if: steps.changelog.outputs.changes == ''
run: |
git tag -d ${{ steps.version.outputs.new_tag }}
git push --delete origin ${{ steps.version.outputs.new_tag }}
documentation:
name: Deploy documentation
needs:
- deploy
uses: wrk-flow/reusable-workflows/.github/workflows/deploy-docs.yml@main
secrets: inherit