-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
keyless releases via workload identities and transparency log support #157
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
on: [push, pull_request] | ||
name: goreleaser | ||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
go-version: [1.16.x, 1.17.x] | ||
os: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.6 | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade iso8601 requests securesystemslib six tuf | ||
- name: Format Unix | ||
if: runner.os == 'Linux' | ||
run: test -z $(go fmt ./...) | ||
- name: Test | ||
run: go test -race -covermode atomic -coverprofile='profile.cov' ./... | ||
- name: Send coverage | ||
if: runner.os == 'Linux' | ||
env: | ||
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
GO111MODULE=off go get github.com/mattn/goveralls | ||
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github | ||
- name: Vet | ||
run: go vet ./... | ||
- name: Install staticcheck | ||
run: "go install honnef.co/go/tools/cmd/[email protected]" | ||
- name: Run staticcheck | ||
run: staticcheck ./... | ||
release-server: | ||
permissions: | ||
id-token: write | ||
contents: write | ||
runs-on: ubuntu-latest | ||
needs: test | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
- name: install cosign | ||
uses: sigstore/cosign-installer@main | ||
with: | ||
cosign-release: 'v1.4.1' | ||
- uses: anchore/sbom-action/[email protected] | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
distribution: goreleaser | ||
version: 'v1.2.5' | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COSIGN_EXPERIMENTAL: 1 | ||
release-cli: | ||
permissions: | ||
id-token: write | ||
contents: write | ||
runs-on: ubuntu-latest | ||
needs: test | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
- name: install cosign | ||
uses: sigstore/cosign-installer@main | ||
with: | ||
cosign-release: 'v1.4.1' | ||
- uses: anchore/sbom-action/[email protected] | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
distribution: goreleaser | ||
version: 'v1.2.5' | ||
args: release --config ./.goreleaser_client.yaml --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COSIGN_EXPERIMENTAL: 1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
project_name: tuf | ||
builds: | ||
- ldflags: | ||
- "-s -w" | ||
- "-extldflags=-zrelro" | ||
- "-extldflags=-znow" | ||
env: | ||
- "CGO_ENABLED=0" | ||
- "GO111MODULE=on" | ||
- "GOFLAGS=-mod=readonly -trimpath" | ||
goos: | ||
- linux | ||
- darwin | ||
- windows | ||
goarch: | ||
- amd64 | ||
main: ./cmd/tuf/ | ||
sboms: | ||
- artifacts: archive | ||
- id: source | ||
artifacts: source | ||
source: | ||
enabled: true | ||
signs: | ||
- cmd: cosign | ||
signature: "${artifact}.sig" | ||
certificate: "${artifact}.pem" | ||
args: ["sign-blob", "--output-signature=${signature}", "--output-certificate=${certificate}", "${artifact}"] | ||
artifacts: all |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
project_name: tuf-client | ||
builds: | ||
- ldflags: | ||
- "-s -w" | ||
- "-extldflags=-zrelro" | ||
- "-extldflags=-znow" | ||
env: | ||
- "CGO_ENABLED=0" | ||
- "GO111MODULE=on" | ||
- "GOFLAGS=-mod=readonly -trimpath" | ||
goos: | ||
- linux | ||
- darwin | ||
- windows | ||
goarch: | ||
- amd64 | ||
main: ./cmd/tuf-client/ | ||
sboms: | ||
- artifacts: archive | ||
signs: | ||
- cmd: cosign | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe we can move the COSIGN_EXPERIMENTAL environment variable over here under the env property of the sign section, WDYT? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You mean in the goreleaser files instead of the github action workflow file? Do you know how? Can you provide a gist? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. of course, let me clarify this example: |
||
signature: "${artifact}.sig" | ||
certificate: "${artifact}.pem" | ||
args: ["sign-blob", "--output-signature=${signature}", "--output-certificate=${certificate}", "${artifact}"] | ||
artifacts: all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can use golangci-lint tool instead of these lines, WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that makes sense. These lines are migrated from the old build workflow.. @asraa @trishankatdatadog are you fine with using golangci-lint instead of staticcheck (golangci-lint calls staticcheck, but can do more).