Skip to content

patch: updates to modules and pipelines #32

patch: updates to modules and pipelines

patch: updates to modules and pipelines #32

Workflow file for this run

name: Build on Tag
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
jobs:
security-checks:
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Build Container
uses: drewbernetes/[email protected]
if: github.event_name != 'pull_request'
id: build-and-scan
with:
image-repo: ghcr.io
repo-username: ${{ github.repository_owner }}
repo-password: ${{ secrets.GITHUB_TOKEN }}
image-name: dogkat
image-tag: ${{ github.ref_name }}
check-severity: CRITICAL
grypeignore-from-s3: true
s3-endpoint: "https://api.s3.hudson-viles.uk"
s3-access-key: ${{secrets.S3_ACCESS_KEY}}
s3-secret-key: ${{secrets.S3_SECRET_KEY}}
s3-bucket: "grypeignores"
s3-path: "dogkat.yaml"
add-latest-tag: true
publish-image: true
cosign-private-key: ${{secrets.COSIGN_KEY}}
cosign-password: ${{secrets.COSIGN_PASSWORD}}
cosign-tlog: true
dockerfile-path: docker
github-token: ${{ secrets.GITHUB_TOKEN }}
release:
name: Create Release
runs-on: ubuntu-24.04
needs: security-checks
permissions:
contents: write
packages: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: '1.23.1'
- name: Build binaries
run: |
for goos in darwin linux windows; do
for goarch in amd64 arm arm64; do
# Skip unsupported combinations
if [[ "$goos" == "darwin" && "$goarch" == "arm" ]]; then continue; fi
if [[ "$goos" == "windows" && ! "$goarch" == "amd64" ]]; then continue; fi
output_file="${{github.repository}}-$goos-$goarch"
if [[ "$goos" == "windows" ]]; then output_file="$output_file.exe"; fi
GOOS=$goos GOARCH=$goarch CGO_ENABLED=0 go build -o $output_file cmd/dogkat/main.go
files="$files\n$output_file"
done
done
echo "files=$files" >> $GITHUB_ENV
- name: Release Notes
run: |
git log $(git describe HEAD~ --tags --abbrev=0)..HEAD --pretty='format:* %h %s - %an <%ae>' --no-merges >> ".github/RELEASE-TEMPLATE.md"
- name: Release with Notes
uses: softprops/action-gh-release@v1
with:
body_path: ".github/RELEASE-TEMPLATE.md"
draft: false
files: ${{ env.files }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v3
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
skip_existing: true