Bump actions/checkout from 3.5.3 to 4.0.0 #43
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: cni-plugin release | |
on: | |
pull_request: | |
paths: | |
- .github/workflows/release-cni-plugin.yml | |
push: | |
tags: ["cni-plugin/v*"] | |
permissions: | |
contents: read | |
jobs: | |
meta: | |
timeout-minutes: 3 | |
runs-on: ubuntu-latest | |
steps: | |
- id: meta | |
shell: bash | |
run: | | |
set -eu | |
shopt -s extglob | |
ref='${{ github.ref }}' | |
if [[ "$ref" == refs/tags/cni-plugin/v+([0-9]).+([0-9]).+([0-9])?(-+([a-z0-9-])) ]]; then | |
( echo version="${ref##refs/tags/cni-plugin/}" | |
echo mode=release | |
) >> "$GITHUB_OUTPUT" | |
else | |
sha='${{ github.sha }}' | |
( echo version="test-${sha:0:7}" | |
echo mode=test | |
) >> "$GITHUB_OUTPUT" | |
fi | |
outputs: | |
repo: ghcr.io/${{ github.repository_owner }}/cni-plugin | |
mode: ${{ steps.meta.outputs.mode }} | |
version: ${{ steps.meta.outputs.version }} | |
docker-publish: | |
needs: meta | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
permissions: | |
id-token: write # needed for signing the images with GitHub OIDC token | |
steps: | |
# Build multi-arch docker images for cni-plugin: | |
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 | |
with: | |
path: ${{ runner.temp }}/.buildx-cache | |
key: cni-plugin-${{ needs.meta.outputs.mode }}-${{ needs.meta.outputs.version }} | |
restore-keys: cni-plugin-${{ needs.meta.outputs.mode }}- | |
- uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 | |
- uses: linkerd/dev/actions/setup-tools@v41 | |
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac | |
- run: | | |
just cni-plugin-image='${{ needs.meta.outputs.repo }}:${{ needs.meta.outputs.version }}' \ | |
build-cni-plugin-image \ | |
--cache-from type=local,src="$RUNNER_TEMP/.buildx-cache" \ | |
--cache-to type=local,dest="$RUNNER_TEMP/.buildx-cache",mode=max \ | |
--platform linux/amd64,linux/arm64,linux/arm/v7 | |
- run: just-dev prune-action-cache "$RUNNER_TEMP/.buildx-cache" | |
# Only publish images on release | |
- if: needs.meta.outputs.mode == 'release' | |
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc | |
with: | |
registry: ghcr.io | |
username: ${{ secrets.DOCKER_GHCR_USERNAME }} | |
password: ${{ secrets.DOCKER_GHCR_PAT }} | |
- if: needs.meta.outputs.mode == 'release' | |
run: | | |
just cni-plugin-image='${{ needs.meta.outputs.repo }}:${{ needs.meta.outputs.version }}' \ | |
build-cni-plugin-image \ | |
--cache-from type=local,src="$RUNNER_TEMP/.buildx-cache" \ | |
--cache-to type=local,dest="$RUNNER_TEMP/.buildx-cache",mode=max \ | |
--platform linux/amd64,linux/arm64,linux/arm/v7 \ | |
--output type=registry | |
- if: needs.meta.outputs.mode == 'release' | |
uses: sigstore/cosign-installer@11086d25041f77fe8fe7b9ea4e48e3b9192b8f19 | |
- if: needs.meta.outputs.mode == 'release' | |
run: cosign sign -y "${{ needs.meta.outputs.repo }}:${{ needs.meta.outputs.version }}" | |
env: | |
COSIGN_EXPERIMENTAL: 1 | |
github: | |
needs: [meta, docker-publish] | |
timeout-minutes: 5 | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac | |
- if: needs.meta.outputs.mode == 'release' | |
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 | |
with: | |
name: cni-plugin ${{ needs.meta.outputs.version }} |