-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
118 lines (100 loc) · 3.85 KB
/
Copy pathrelease.yml
File metadata and controls
118 lines (100 loc) · 3.85 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
name: Release
on:
push:
tags:
- 'v*'
- 'alpha*'
- 'beta*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to release (e.g., v0.58.8)'
required: true
type: string
clobber:
description: 'Overwrite existing release assets (--clobber)'
required: false
type: boolean
default: false
jobs:
# Build and sign all binaries (reuses build.yml workflow)
build-and-sign:
name: Build and Sign All Binaries
uses: ./.github/workflows/build.yml
permissions:
contents: write
id-token: write
actions: read
secrets: inherit
# Upload binaries to existing GitHub release
upload-assets:
name: Upload Release Assets
needs: build-and-sign
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
actions: read
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Get version
id: version
env:
INPUT_TAG: ${{ inputs.tag }}
EVENT_NAME: ${{ github.event_name }}
run: .github/scripts/release/get-version.sh
- name: Check if release exists
id: check_release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.version.outputs.version }}
run: .github/scripts/release/check-release-exists.sh
- name: Download pre-built signed binaries
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: all-signed-binaries
path: bin/
- name: Verify binaries downloaded
run: .github/scripts/release/verify-binaries-downloaded.sh bin 7
- name: Set execution permissions on binaries
run: .github/scripts/release/set-permissions.sh bin
- name: Create ZIP and TAR.GZ archives
run: .github/scripts/release/create-archives.sh bin
- name: Generate SHA256SUMS
run: .github/scripts/release/generate-checksums.sh bin
- name: Import GPG key and export public key
env:
SIGNING_GPG_PRIVATE_KEY: ${{ secrets.SIGNING_GPG_PRIVATE_KEY }}
run: |
echo "${SIGNING_GPG_PRIVATE_KEY}" | base64 --decode | gpg --batch --import
GPG_FINGERPRINT=$(gpg --list-secret-keys --keyid-format LONG | awk '/^sec/{sub(/.*\//, "", $2); print $2; exit}')
echo "GPG_FINGERPRINT=${GPG_FINGERPRINT}" >> "${GITHUB_ENV}"
gpg --armor --export "${GPG_FINGERPRINT}" > bin/terragrunt-signing-key.asc
- name: Install Cosign
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4
- name: Sign SHA256SUMS
env:
SIGNING_GPG_PASSPHRASE: ${{ secrets.SIGNING_GPG_PASSPHRASE }}
run: .github/scripts/release/sign-checksums.sh bin
- name: Verify signatures before upload
run: .github/scripts/release/verify-files.sh bin
- name: Upload assets to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.version.outputs.version }}
CLOBBER: ${{ github.event_name == 'workflow_dispatch' && inputs.clobber || 'false' }}
run: .github/scripts/release/upload-assets.sh bin
- name: Verify all assets uploaded
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.version.outputs.version }}
CLOBBER: ${{ github.event_name == 'workflow_dispatch' && inputs.clobber || 'false' }}
run: .github/scripts/release/verify-assets-uploaded.sh bin
- name: Upload summary
if: always()
env:
VERSION: ${{ steps.version.outputs.version }}
RELEASE_ID: ${{ steps.check_release.outputs.release_id }}
IS_DRAFT: ${{ steps.check_release.outputs.is_draft }}
run: .github/scripts/release/generate-upload-summary.sh