Migrate fork to DG org #4
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
--- | |
# This workflow is triggered whenever we release a new version of trivy-operator | |
# by creating an annotated Git tag and pushing it to the upstream Git repository. | |
# | |
# git tag -a v0.0.1 -m 'Release v0.0.1' | |
# git push upstream v0.0.1 | |
name: Release | |
on: | |
push: | |
tags: | |
- "v*" | |
env: | |
KIND_VERSION: v0.17.0 | |
KIND_IMAGE: kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6 | |
GO_VERSION: '1.22' | |
jobs: | |
tests: | |
name: Run tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Install tools | |
uses: aquaproj/aqua-installer@v3.0.1 | |
with: | |
aqua_version: v1.25.0 | |
- name: Run unit tests | |
run: mage test:unit | |
release: | |
name: Release | |
needs: | |
- tests | |
runs-on: ubuntu-latest | |
env: | |
DOCKER_CLI_EXPERIMENTAL: "enabled" | |
permissions: | |
contents: write | |
id-token: write | |
packages: write | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Available platforms | |
run: echo ${{ steps.buildx.outputs.platforms }} | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Install cosign | |
uses: sigstore/cosign-installer@v3.6.0 | |
- name: Login to ghcr registry | |
uses: docker/login-action@v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Release | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
version: v1.7.0 | |
args: release --rm-dist | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COSIGN_EXPERIMENTAL: 1 |