Skip to content

Commit ea84c69

Browse files
committed
feat: release artifact attestations
1 parent 7bd7d72 commit ea84c69

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

.github/workflows/publish.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ jobs:
77
publish_release:
88
name: Release
99
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
id-token: write
13+
attestations: write
1014
steps:
1115
- name: Checkout head
1216
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -48,6 +52,10 @@ jobs:
4852
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
4953
- name: Clear Docker login session
5054
run: rm -f ${HOME}/.docker/config.json
55+
- name: Generate artifact attestations
56+
uses: actions/attest-build-provenance@f9eaf234fc1c2e333c1eca18177db0f44fa6ba52 # v2.2.1
57+
with:
58+
subject-checksums: dist/checksums.txt
5159
- name: Generate AUR PKGBUILD
5260
run: ./scripts/generate_aur_pkgbuild.sh ${{ steps.git.outputs.tag_version }}
5361
- name: Publish AUR package

RELEASING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
- sets the version based on the tag
99
- creates a draft release to GitHub
1010
- populates the release notes from `CHANGELOG.md` with `make release-notes`
11-
- builds and uploads binaries & SHA sum for given release
11+
- builds, uploads, and generates provenance for given release
1212
5. Verify that [release notes](https://github.com/UpCloudLtd/upcloud-cli/releases) are in line with `CHANGELOG.MD`
1313
6. Publish the drafted release

docs/index.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ using a package manager, Docker image, or from sources with `go install`:
1616

1717
```sh
1818
curl -Lo upcloud-cli_{{ latest_release }}_amd64.deb https://github.com/UpCloudLtd/upcloud-cli/releases/download/v{{ latest_release }}/upcloud-cli_{{ latest_release }}_amd64.deb
19+
# Preferably verify the asset before proceeding with install, see "Verify assets" below
1920
sudo apt install ./upcloud-cli_{{ latest_release }}_amd64.deb
2021
```
2122

2223
On RHEL based distributions, use the `.rpm` package.
2324

2425
```sh
2526
curl -Lo upcloud-cli-{{ latest_release }}-1.x86_64.rpm https://github.com/UpCloudLtd/upcloud-cli/releases/download/v{{ latest_release }}/upcloud-cli-{{ latest_release }}-1.x86_64.rpm
27+
# Preferably verify the asset before proceeding with install, see "Verify assets" below
2628
sudo dnf install ./upcloud-cli-{{ latest_release }}-1.x86_64.rpm
2729
```
2830

@@ -41,6 +43,7 @@ using a package manager, Docker image, or from sources with `go install`:
4143

4244
```pwsh
4345
Invoke-WebRequest -Uri "https://github.com/UpCloudLtd/upcloud-cli/releases/download/v{{ latest_release }}/upcloud-cli_{{ latest_release }}_windows_x86_64.zip" -OutFile "upcloud-cli_{{ latest_release }}_windows_x86_64.zip"
46+
# Preferably verify the asset before proceeding with install, see "Verify assets" below
4447
Expand-Archive -Path "upcloud-cli_{{ latest_release }}_windows_x86_64.zip"
4548

4649
# Print current location
@@ -106,6 +109,35 @@ After installing `upctl`, you can run `upctl version` command to verify that the
106109
upctl version
107110
```
108111

112+
### Verify assets
113+
114+
[GitHub artifact attestations](https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations)
115+
and plain old checksum files are available for verifying release assets.
116+
117+
=== "Attestations"
118+
119+
[Release asset artifact attestations](https://github.com/UpCloudLtd/upcloud-cli/attestations)
120+
can be verified for example with the [GitHub CLI](https://github.com/cli/cli),
121+
using the Linux x86_64 asset as an example:
122+
123+
```sh
124+
gh attestation verify \
125+
/path/to/locally/downloaded/upcloud-cli_{{ latest_release }}_linux_x86_64.tar.gz \
126+
--repo UpCloudLtd/upcloud-cli
127+
```
128+
129+
Attestations are available starting from version 3.16.0.
130+
131+
=== "Digests"
132+
133+
Release assets' SHA-256 digests are available in releases,
134+
in asset named `checksums.txt`. They can be checked for example with:
135+
136+
```sh
137+
# make sure at least one downloaded asset and checksums.txt are in the current directory
138+
sha256sum -c --ignore-missing checksums.txt
139+
```
140+
109141
### Configure shell completions
110142

111143
`upctl` provides shell completions for multiple shells. Run `upctl completion --help` to list the supported shells.

0 commit comments

Comments
 (0)