Skip to content

chore(deps): update actions/attest-build-provenance action to v3.2.0 … #634

chore(deps): update actions/attest-build-provenance action to v3.2.0 …

chore(deps): update actions/attest-build-provenance action to v3.2.0 … #634

Workflow file for this run

name: Go Checks
on:
push:
tags:
- 'v*'
branches:
- main
paths:
- 'go.sum'
- 'go.mod'
- '**.go'
- .github/workflows/golang.yml
- '.goreleaser.yml'
pull_request:
branches:
- main
paths:
- '**.go'
- 'go.sum'
- 'go.mod'
permissions:
security-events: write
actions: write
packages: write
contents: read
id-token: write
attestations: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Test:
if: ${{ startsWith(github.ref, 'refs/tags/v') == false }}
runs-on: ubuntu-latest
env:
GO111MODULE: on
GOTEST_SUM_VERSION: v1.13.0
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version-file: go.mod
cache: true
- name: Install gotestsum
run: go install gotest.tools/gotestsum@${{ env.GOTEST_SUM_VERSION }}
- name: Test
run: make test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
use_oidc: true
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1.2.1
with:
use_oidc: true
Snapshot:
if: ${{ startsWith(github.ref, 'refs/tags/v') == false && github.ref != 'refs/heads/main' }}
runs-on: windows-latest
env:
GO111MODULE: on
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version-file: go.mod
cache: true
- name: Install Syft
run: choco install syft --yes
- name: Download AutoComplete file
run: Invoke-WebRequest -Uri https://raw.githubusercontent.com/urfave/cli/v3.1.1/autocomplete/bash_autocomplete -OutFile bash_completion
- name: GoReleaser Action
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
with:
version: '~> v2'
args: --snapshot --clean --skip=publish,sign
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload assets
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: cloudflare-utils
path: dist/*
- name: Upload to R2
run: |
aws s3 cp dist/ s3://github-actions-artifacts/snapshots/cloudflare-utils/${{ github.sha }} --recursive --checksum-algorithm CRC32
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ENDPOINT_URL_S3: https://8be772befd147a8df540aae0fa15c047.r2.cloudflarestorage.com
Release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: windows-latest
env:
GO111MODULE: on
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version-file: go.mod
cache: true
- name: Install Syft
run: choco install syft --yes
- name: Download AutoComplete file
run: Invoke-WebRequest -Uri https://raw.githubusercontent.com/urfave/cli/v2.25.7/autocomplete/bash_autocomplete -OutFile bash_completion
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec # v6.3.0
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
with:
version: '~> v2'
args: release --clean
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
BLUESKY_APP_PASSWORD: ${{ secrets.BLUESKY_APP_PASSWORD }}
- name: Upload release assets
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: cloudflare-utils-release
path: dist/*
CreateAttestation:
if: startsWith(github.ref, 'refs/tags/v')
needs: Release
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- name: Download the release assets
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: cloudflare-utils-release
- uses: actions/attest-build-provenance@96278af6caaf10aea03fd8d33a09a777ca52d62f # v3.2.0
with:
subject-checksums: ./checksums.txt