Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Release

on:
release:
types: [published]

permissions:
contents: read

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false

jobs:
release:
name: Build and publish release artifacts
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
id-token: write
steps:
- name: Check out the code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod

- name: Install Cosign
uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
with:
cosign-release: v3.1.3

- name: Install Syft
uses: anchore/sbom-action/download-syft@66cbf4bc1f1c0d2edc94016e65bc221b6bb0ad6c # v0.24.3
with:
syft-version: v1.55.0

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@a4f02ab5355a589de60d917a659ce617ed19b3de # v7.3.0
with:
distribution: goreleaser
version: v2.19.0
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Verify signatures
env:
IDENTITY: ${{ github.server_url }}/${{ github.workflow_ref }}
run: |
set -eu
for file in dist/release/*.spdx.json dist/release/*_checksums.txt dist/release/schedctl_*/schedctl; do
cosign verify-blob \
--bundle "${file}.sigstore.json" \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-identity "$IDENTITY" \
"$file"
done
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ go.work.sum

# Local build
/schedctl
/dist/release/

53 changes: 53 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
version: 2

project_name: schedctl

dist: dist/release

builds:
- id: schedctl
main: .
binary: schedctl
env:
- CGO_ENABLED=0
tags:
- containers_image_openpgp
flags:
- -trimpath
goos:
- linux
goarch:
- amd64
- arm64
ldflags:
- -s -w

archives:
- id: schedctl
formats:
- binary
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"

checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
algorithm: sha256

sboms:
- artifacts: binary
documents:
- "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}.spdx.json"

signs:
- cmd: cosign
artifacts: all
signature: "${artifact}.sigstore.json"
args:
- sign-blob
- "--bundle=${signature}"
- "${artifact}"
- "--yes"

release:
prerelease: auto
mode: keep-existing
replace_existing_artifacts: true
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,41 @@ sudo zypper in schedctl
paru -S schedctl
```

### Prebuilt binaries

Releases include static Linux binaries for x86_64 (`amd64`) and `arm64`, an
SPDX SBOM for each binary, and a checksums file. The binaries, SBOMs, and
checksums are signed with
[Cosign](https://docs.sigstore.dev/cosign/system_config/installation/) using
GitHub Actions OIDC. The commands below assume Cosign 3.x.

Download a release:

```sh
tag=v1.3.1
gh release download "$tag" --repo schedkit/schedctl
```

Verify the signatures:

```sh
tag=v1.3.1
identity="https://github.com/schedkit/schedctl/.github/workflows/release.yml@refs/tags/$tag"
for bundle in *.sigstore.json; do
cosign verify-blob \
--bundle "$bundle" \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-identity "$identity" \
"${bundle%.sigstore.json}"
done
```

Then check the files against the checksums:

```sh
sha256sum --check --ignore-missing schedctl_*_checksums.txt
```

## Container engine setup

### Podman
Expand Down
Loading