Skip to content

Commit a8ab38b

Browse files
fix: manual full release workflow (#1763)
Signed-off-by: matttrach <[email protected]> Co-authored-by: Matt Trachier <[email protected]>
1 parent e42cccb commit a8ab38b

File tree

4 files changed

+82
-0
lines changed

4 files changed

+82
-0
lines changed

.github/workflows/manual-rc-release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
description: 'The rc tag to create, e.g. v1.2.3-rc.1'
88
required: true
99

10+
permissions:
11+
contents: write
12+
id-token: write
13+
actions: read
14+
1015
jobs:
1116
rc-release:
1217
runs-on: ubuntu-latest
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Manually Create Full Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'The tag to create, make sure to select the correct branch.'
8+
required: true
9+
sha:
10+
description: 'The commit SHA to create the tag from, defaults to HEAD of the selected branch.'
11+
required: false
12+
13+
permissions:
14+
contents: write
15+
id-token: write
16+
actions: read
17+
18+
jobs:
19+
release:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 https://github.com/actions/checkout
23+
with:
24+
fetch-depth: 0
25+
- name: Create and Push Tag with Git
26+
id: create-push-tag
27+
env:
28+
TAG: ${{ inputs.tag }}
29+
SHA: ${{ inputs.sha }}
30+
run: |
31+
git config user.name "${{ github.actor }}"
32+
git config user.email "${{ github.actor }}@users.noreply.github.com"
33+
if [ -n "${SHA}" ]; then
34+
git checkout "$SHA"
35+
fi
36+
git tag "$TAG" -m "Release $TAG"
37+
git push origin "$TAG"
38+
- name: retrieve GPG Credentials
39+
id: retrieve-gpg-credentials
40+
uses: rancher-eio/read-vault-secrets@main
41+
with:
42+
secrets: |
43+
secret/data/github/repo/${{ github.repository }}/signing/gpg passphrase | GPG_PASSPHRASE ;
44+
secret/data/github/repo/${{ github.repository }}/signing/gpg privateKeyId | GPG_KEY_ID ;
45+
secret/data/github/repo/${{ github.repository }}/signing/gpg privateKey | GPG_KEY
46+
- name: import_gpg_key
47+
id: import-gpg-key
48+
env:
49+
GPG_PASSPHRASE: ${{ env.GPG_PASSPHRASE }}
50+
GPG_KEY_ID: ${{ env.GPG_KEY_ID }}
51+
GPG_KEY: ${{ env.GPG_KEY }}
52+
run: |
53+
cleanup() {
54+
# clear history just in case
55+
history -c
56+
}
57+
trap cleanup EXIT TERM
58+
59+
# sanitize variables
60+
if [ -z "${GPG_PASSPHRASE}" ]; then echo "gpg passphrase empty"; exit 1; fi
61+
if [ -z "${GPG_KEY_ID}" ]; then echo "key id empty"; exit 1; fi
62+
if [ -z "${GPG_KEY}" ]; then echo "key contents empty"; exit 1; fi
63+
64+
echo "Importing gpg key"
65+
echo "${GPG_KEY}" | gpg --import --batch > /dev/null || { echo "Failed to import GPG key"; exit 1; }
66+
- name: Run GoReleaser
67+
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 https://github.com/goreleaser/goreleaser-action
68+
with:
69+
args: release --clean --config .goreleaser_rc.yml
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
GPG_KEY_ID: ${{ env.GPG_KEY_ID }}
73+
GPG_PASSPHRASE: ${{ env.GPG_PASSPHRASE }}

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ jobs:
189189
steps:
190190
# If the e2e tests pass we automatically generate an RC release
191191
# this shouldn't happen when the release PR is merged, only when it's opened or updated
192+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 https://github.com/actions/checkout
193+
with:
194+
fetch-depth: 0
192195
- name: Create and Push RC Tag with Git
193196
id: create-push-rc-tag
194197
run: |

aspell_custom.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ aws
55
azure
66
config
77
eks
8+
globbing
89
git
910
github
1011
kubeconfig

0 commit comments

Comments
 (0)