Skip to content

build(deps): Bump sigstore/cosign-installer from 3.10.0 to 4.0.0 (#39) #3

build(deps): Bump sigstore/cosign-installer from 3.10.0 to 4.0.0 (#39)

build(deps): Bump sigstore/cosign-installer from 3.10.0 to 4.0.0 (#39) #3

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
name: Release Container
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
with:
go-version-file: 'go.mod'
cache: true
- name: Install Task
uses: arduino/setup-task@v2
with:
version: '3.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: task install
- name: Test
run: task test
- name: Setup Ko
uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9
- name: Log in to GitHub Container Registry
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract tag version
id: tag
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Set repository owner lowercase
id: repo_owner
run: echo "OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
- name: Build and push container
env:
KO_DOCKER_REPO: ghcr.io/${{ steps.repo_owner.outputs.OWNER }}/yardstick
VERSION: ${{ steps.tag.outputs.VERSION }}
CREATION_TIME: $(date -u +'%Y-%m-%dT%H:%M:%SZ')
run: |
# Build and push the container with reproducible build flags
ko build \
--bare \
--sbom=spdx \
--platform=linux/amd64,linux/arm64 \
--base-import-paths \
--tags $VERSION,latest \
./cmd/yardstick-server
- name: Install Cosign
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
- name: Sign Image with Cosign
env:
KO_DOCKER_REPO: ghcr.io/${{ steps.repo_owner.outputs.OWNER }}/yardstick
run: |
TAG=$(echo "${{ steps.tag.outputs.VERSION }}" | sed 's/+/_/g')
# Sign the ko image
cosign sign -y $KO_DOCKER_REPO/server:$TAG
# Sign the latest tag if building from a tag
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
cosign sign -y $KO_DOCKER_REPO/server:latest
fi