Skip to content

:dependabot: chore(deps): Bump the actions group across 1 directory w… #3

:dependabot: chore(deps): Bump the actions group across 1 directory w…

:dependabot: chore(deps): Bump the actions group across 1 directory w… #3

Workflow file for this run

# ------------------------------------------------------------------------
# SPDX-FileCopyrightText: Copyright © 2024 bomctl a Series of LF Projects, LLC
# SPDX-FileName: .github/workflows/goreleaser.yml
# SPDX-FileType: SOURCE
# SPDX-License-Identifier: Apache-2.0
# ------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ------------------------------------------------------------------------
---
name: goreleaser
on:
push:
branches: main
tags: v*
permissions:
contents: read
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write # needed to write releases
id-token: write # needed for cosign
attestations: write # needed for attestations
steps:
- name: Checkout code
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: go.mod
cache: false
- name: Install Cosign
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
with:
cosign-release: v2.2.4
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
- name: Install Syft
uses: anchore/sbom-action/download-syft@61119d458adab75f756bc0b9e4bde25725f86a7a # v0.17.2
- name: Get GitHub App installation token
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
id: app-token
with:
app-id: ${{ vars.GORELEASER_BOT_APP_ID }}
private-key: ${{ secrets.GORELEASER_BOT_RSA_PRIVATE_KEY }}
owner: bomctl
repositories: homebrew-bomctl
- name: Login to Docker Hub
if: startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Pull base container image
run: docker pull cgr.dev/chainguard/static:latest
- name: Verify base container image
run: cosign verify
--certificate-oidc-issuer=https://token.actions.githubusercontent.com
--certificate-identity=https://github.com/chainguard-images/images/.github/workflows/release.yaml@refs/heads/main
cgr.dev/chainguard/static:latest
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
with:
distribution: goreleaser
version: latest
args: release --clean ${{ env.SNAPSHOT }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
SNAPSHOT: ${{ github.ref_type != 'tag' && '--snapshot' || '' }}
- name: Attest Archives
if: startsWith(github.ref, 'refs/tags/')
uses: actions/attest-build-provenance@1c608d11d69870c2092266b3f9a6f3abbf17002c # v1.4.3
with:
subject-path: dist/*[.zrda][gipep][zpbk] # match .gz, zip, deb, apk
- name: Attest Artifacts
if: startsWith(github.ref, 'refs/tags/')
uses: actions/attest-build-provenance@1c608d11d69870c2092266b3f9a6f3abbf17002c # v1.4.3
with:
subject-path: dist/bomctl*/* # match all binaries created
- name: Archive production artifacts
uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4.4.1
with:
name: dist
path: |
dist
!dist/syft-
retention-days: 3