-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (93 loc) · 2.72 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Release
on:
workflow_dispatch:
inputs:
tag:
description: Tag (version) to be associated with the ongoing release (for example, "v1.0.0")
type: string
pull_request:
types: [ closed ]
branches: [ master ]
jobs:
version:
name: Increment version
runs-on: ubuntu-latest
steps:
- name: 🦾 Predict next SemVer tag based on PR label
id: predicted-tag
if: github.event.pull_request.merged
uses: K-Phoen/semver-release-action@v1.3.2
with:
release_branch: master
release_strategy: none
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
- name: 💪 Use input tag if triggered manually
id: final-tag
if: success() || failure()
run: |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then
tag=${{ inputs.tag }}
else
tag=${{ steps.predicted-tag.outputs.tag }}
fi
echo "tag=$tag" >> $GITHUB_OUTPUT
outputs:
tag: ${{ steps.final-tag.outputs.tag }}
release:
name: Publish GitHub release
needs: version
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.release.outputs.upload_url }}
steps:
- name: 🔽 Checkout repository
uses: actions/checkout@v4
- name: 📝 Create changelog
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
github-token: ${{ secrets.github_token }}
output-file: false
git-push: false
skip-on-empty: false
skip-version-file: true
skip-tag: true
skip-commit: true
- name: 🎁 Publish GitHub release
id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
with:
tag_name: ${{ needs.version.outputs.tag }}
release_name: ${{ needs.version.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
publish-api:
name: Publish API
needs: release
uses: ./.github/workflows/openapi.yml
with:
openapi_asset_upload_url: ${{ needs.release.outputs.upload_url }}
secrets: inherit
deliver:
name: Deliver
needs: version
uses: ./.github/workflows/delivery.yml
with:
version: ${{ needs.version.outputs.tag }}
secrets: inherit
notify:
name: Notify
needs: [ version, deliver ]
uses: ./.github/workflows/notification.yml
with:
version: ${{ needs.version.outputs.tag }}
secrets: inherit
deploy:
name: Deploy
needs: [ version, deliver ]
uses: ./.github/workflows/deployment.yml
with:
version: ${{ needs.version.outputs.tag }}
secrets: inherit