-
Notifications
You must be signed in to change notification settings - Fork 26
127 lines (109 loc) · 4.09 KB
/
Copy pathrelease-assets.yml
File metadata and controls
127 lines (109 loc) · 4.09 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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Upload release assets
# When a GitHub release is published, render the install manifests for that
# tag's image and attach them to the release. `make build-dist-manifests` is
# `helm template` of the chart with image.repository/tag set to the released
# ref; the chart renders image == OPERATOR_IMAGE, so the attached YAML deploys
# the matching operator and its snapshot/restore agent. For consumers who
# kubectl-apply rather than helm-install.
#
# Trigger is `published`, NOT `created`: the intended flow is release-drafter
# maintaining a draft that a maintainer then publishes, and the `created`
# activity type does NOT fire when a draft is published (only `published`
# does). With `created` the assets silently never attach for any draft-based
# release. `published` also covers a release created already-public. The
# manual `workflow_dispatch` (run against the tag ref) is the backfill path
# for a release that was published before this fix.
on:
release:
types: [ published ]
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
release-assets:
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
# build-dist-manifests renders the chart via `helm template`.
- name: Install Helm
uses: azure/setup-helm@v4
with:
version: 'v3.16.4'
- name: Resolve release tag
env:
REF_NAME: ${{ github.ref_name }}
run: echo "RELEASE_TAG=$REF_NAME" >> "$GITHUB_ENV"
- name: Render install manifests
run: make build-dist-manifests IMG="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${RELEASE_TAG}"
- uses: svenstaro/upload-release-action@2.9.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/etcd-operator.yaml
asset_name: etcd-operator.yaml
tag: ${{ github.ref }}
overwrite: true
- uses: svenstaro/upload-release-action@2.9.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/etcd-operator.crds.yaml
asset_name: etcd-operator.crds.yaml
tag: ${{ github.ref }}
overwrite: true
- uses: svenstaro/upload-release-action@2.9.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/etcd-operator.non-crds.yaml
asset_name: etcd-operator.non-crds.yaml
tag: ${{ github.ref }}
overwrite: true
# Standalone client CLIs (kubectl-etcd plugin + etcd-migrate). They are not in
# the operator image (client-side / admin tools), so they ship as
# cross-compiled release binaries. Separate job: no Helm needed, and a failure
# here doesn't block the manifest assets above.
cli-binaries:
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Resolve release tag
env:
REF_NAME: ${{ github.ref_name }}
run: echo "RELEASE_TAG=$REF_NAME" >> "$GITHUB_ENV"
- name: Cross-compile CLIs
run: make dist-cli VERSION="${RELEASE_TAG}"
- name: Upload etcd-migrate binaries
uses: svenstaro/upload-release-action@2.9.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/etcd-migrate-*
file_glob: true
tag: ${{ github.ref }}
overwrite: true
- name: Upload kubectl-etcd binaries
uses: svenstaro/upload-release-action@2.9.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/kubectl-etcd-*
file_glob: true
tag: ${{ github.ref }}
overwrite: true
- name: Upload CLI checksums
uses: svenstaro/upload-release-action@2.9.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/cli-SHA256SUMS.txt
asset_name: cli-SHA256SUMS.txt
tag: ${{ github.ref }}
overwrite: true