forked from Lucretius/vault_raft_snapshot_agent
-
Notifications
You must be signed in to change notification settings - Fork 4
102 lines (87 loc) · 2.52 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
96
97
98
99
100
101
name: Create or update Release
on:
workflow_dispatch:
push:
tags:
- "v**.**.**"
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true
jobs:
run-checks:
uses: ./.github/workflows/checks.yml
create-draft-release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs:
- run-checks
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create or update Release
uses: "ncipollo/release-action@v1"
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag: ${{ github.ref_name }}
name: "Release ${{ github.ref_name }}"
draft: true
generateReleaseNotes: true
allowUpdates: false
updateOnlyUnreleased: true
skipIfReleaseExists: true
artifactErrorsFailBuild: true
artifacts: LICENSE.txt
release-binaries:
if: always() && !cancelled() && !failure()
uses: ./.github/workflows/release-binaries.yml
secrets: inherit
needs:
- create-draft-release
release-container-images:
if: always() && !cancelled() && !failure()
uses: ./.github/workflows/release-container-image.yml
secrets: inherit
needs:
- release-binaries
- create-draft-release
publish-release:
if: startsWith(github.ref, 'refs/tags/v') && !cancelled() && !failure()
runs-on: ubuntu-latest
needs:
- create-draft-release
- release-binaries
- release-container-images
outputs:
latest-release: ${{ steps.latest-release.outputs.tag_name }}
steps:
- name: Get latest release
uses: cardinalby/git-get-release-action@v1
id: latest-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
latest: true
draft: true
prerelease: false
- name: Publish release
uses: "ncipollo/release-action@v1"
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag: ${{ github.ref.name }}
allowUpdates: true
draft: false
makeLatest: ${{ steps.latest-release.outputs.tag_name == github.ref_name }}
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
skipIfReleaseExists: false
updateOnlyUnreleased: false
release-helm-charts:
if: needs.publish-release.outputs.latest-release == github.ref_name
uses: ./.github/workflows/release-helm-charts.yml
with:
latest-release: ${{ needs.publish-release.outputs.latest-release }}
secrets: inherit
needs:
- publish-release