mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-08-19 20:26:38 +00:00
--- updated-dependencies: - dependency-name: golang/govulncheck-action dependency-version: 1.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: fluxcd/flux2/action dependency-version: 2.9.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: fluxcd/flux-schema/actions/setup dependency-version: 0.10.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com>
163 lines
7.5 KiB
YAML
163 lines
7.5 KiB
YAML
name: release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write # needed to write releases
|
|
id-token: write # needed for keyless signing
|
|
packages: write # needed for ghcr access
|
|
attestations: write # needed for provenance
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
- uses: ./.github/actions/runner-cleanup
|
|
- uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
|
|
- uses: fluxcd/flux2/action@f05a280b876a3a1d35a76a91f701e605777853aa # v2.9.1
|
|
- uses: stefanprodan/timoni/actions/setup@69e421aebbed979ded721df0da2a54428c5b4b9c # v0.27.0
|
|
- name: Setup Notation CLI
|
|
uses: notaryproject/notation-action/setup@b6fee73110795d6793253c673bd723f12bcf9bbb # v1.2.2
|
|
with:
|
|
version: "1.1.0"
|
|
- name: Setup Notation signing keys
|
|
run: |
|
|
mkdir -p ~/.config/notation/localkeys/
|
|
cp ./.notation/signingkeys.json ~/.config/notation/
|
|
cp ./.notation/notation.crt ~/.config/notation/localkeys/
|
|
echo "$NOTATION_KEY" > ~/.config/notation/localkeys/notation.key
|
|
env:
|
|
NOTATION_KEY: ${{ secrets.NOTATION_SIGNING_KEY }}
|
|
- name: Setup Go
|
|
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
|
|
with:
|
|
go-version: 1.26.x
|
|
- name: Setup Helm
|
|
uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
|
|
with:
|
|
version: v4.2.0
|
|
- name: Setup QEMU
|
|
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0
|
|
with:
|
|
platforms: all
|
|
- name: Setup Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
- name: Prepare
|
|
id: prep
|
|
run: |
|
|
VERSION=sha-${GITHUB_SHA::8}
|
|
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
|
VERSION=${GITHUB_REF/refs\/tags\//}
|
|
fi
|
|
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
|
|
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
|
|
echo "REVISION=${GITHUB_SHA}" >> $GITHUB_OUTPUT
|
|
- name: Generate images meta
|
|
id: meta
|
|
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
|
|
with:
|
|
images: |
|
|
docker.io/stefanprodan/podinfo
|
|
ghcr.io/stefanprodan/podinfo
|
|
tags: |
|
|
type=raw,value=${{ steps.prep.outputs.VERSION }}
|
|
type=raw,value=latest
|
|
- name: Publish multi-arch image
|
|
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
|
|
with:
|
|
sbom: true
|
|
provenance: true
|
|
push: true
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
context: .
|
|
file: ./Dockerfile
|
|
build-args: |
|
|
REVISION=${{ steps.prep.outputs.REVISION }}
|
|
platforms: linux/amd64,linux/arm64
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
- name: Publish Timoni module to GHCR
|
|
run: |
|
|
timoni mod push ./timoni/podinfo oci://ghcr.io/stefanprodan/modules/podinfo \
|
|
--sign cosign \
|
|
--version ${{ steps.prep.outputs.VERSION }} \
|
|
-a 'org.opencontainers.image.source=https://github.com/stefanprodan/podinfo' \
|
|
-a 'org.opencontainers.image.licenses=Apache-2.0' \
|
|
-a 'org.opencontainers.image.description=A timoni.sh module for deploying Podinfo.' \
|
|
-a 'org.opencontainers.image.documentation=https://github.com/stefanprodan/podinfo/blob/main/timoni/podinfo/README.md'
|
|
- name: Publish Helm chart to GHCR
|
|
run: |
|
|
helm package charts/podinfo
|
|
helm push podinfo-${{ steps.prep.outputs.VERSION }}.tgz oci://ghcr.io/stefanprodan/charts
|
|
rm podinfo-${{ steps.prep.outputs.VERSION }}.tgz
|
|
- name: Publish Flux OCI artifact to GHCR
|
|
run: |
|
|
flux push artifact oci://ghcr.io/stefanprodan/manifests/podinfo:${{ steps.prep.outputs.VERSION }} \
|
|
--path="./kustomize" \
|
|
--source="${{ github.event.repository.html_url }}" \
|
|
--revision="${GITHUB_REF_NAME}@sha1:${GITHUB_SHA}"
|
|
flux tag artifact oci://ghcr.io/stefanprodan/manifests/podinfo:${{ steps.prep.outputs.VERSION }} --tag latest
|
|
- name: Sign artifacts with Cosign
|
|
env:
|
|
COSIGN_EXPERIMENTAL: 1
|
|
run: |
|
|
cosign sign docker.io/stefanprodan/podinfo:${{ steps.prep.outputs.VERSION }} --yes
|
|
cosign sign ghcr.io/stefanprodan/podinfo:${{ steps.prep.outputs.VERSION }} --yes
|
|
cosign sign ghcr.io/stefanprodan/charts/podinfo:${{ steps.prep.outputs.VERSION }} --yes
|
|
cosign sign ghcr.io/stefanprodan/manifests/podinfo:${{ steps.prep.outputs.VERSION }} --yes
|
|
- name: Publish helm chart
|
|
uses: stefanprodan/helm-gh-pages@0ad2bb377311d61ac04ad9eb6f252fb68e207260 # v1.7.0
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Publish config artifact
|
|
run: |
|
|
flux push artifact oci://ghcr.io/stefanprodan/podinfo-deploy:${{ steps.prep.outputs.VERSION }} \
|
|
--path="./kustomize" \
|
|
--source="${{ github.event.repository.html_url }}" \
|
|
--revision="${GITHUB_REF_NAME}@sha1:${GITHUB_SHA}"
|
|
flux tag artifact oci://ghcr.io/stefanprodan/podinfo-deploy:${{ steps.prep.outputs.VERSION }} --tag latest
|
|
- name: Sign config artifact with cso
|
|
run: |
|
|
echo "$COSIGN_KEY" > /tmp/cosign.key
|
|
cosign sign -key /tmp/cosign.key ghcr.io/stefanprodan/podinfo-deploy:${{ steps.prep.outputs.VERSION }} --yes
|
|
cosign sign -key /tmp/cosign.key ghcr.io/stefanprodan/podinfo-deploy:latest --yes
|
|
env:
|
|
COSIGN_PASSWORD: ${{secrets.COSIGN_PASSWORD}}
|
|
COSIGN_KEY: ${{secrets.COSIGN_KEY}}
|
|
- name: Sign artifacts with Notation
|
|
run: |
|
|
notation sign --signature-format cose ghcr.io/stefanprodan/podinfo:${{ steps.prep.outputs.VERSION }}
|
|
notation sign --signature-format cose ghcr.io/stefanprodan/charts/podinfo:${{ steps.prep.outputs.VERSION }}
|
|
notation sign --signature-format cose ghcr.io/stefanprodan/manifests/podinfo:${{ steps.prep.outputs.VERSION }}
|
|
notation sign --signature-format cose ghcr.io/stefanprodan/podinfo-deploy:${{ steps.prep.outputs.VERSION }}
|
|
notation sign --signature-format cose ghcr.io/stefanprodan/podinfo-deploy:latest
|
|
- name: Publish release
|
|
uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3
|
|
with:
|
|
version: latest
|
|
args: release --skip=validate
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Attest release
|
|
uses: actions/attest@a1948c3f048ba23858d222213b7c278aabede763 # v4.1.1
|
|
with:
|
|
subject-checksums: ./dist/podinfo_${{ steps.prep.outputs.VERSION }}_checksums.txt
|