Skip to content

Remove golangci-lint.yml GHA workflow (redundant) #1

Remove golangci-lint.yml GHA workflow (redundant)

Remove golangci-lint.yml GHA workflow (redundant) #1

Workflow file for this run

name: Release
on:
push:
tags: ["v*"]
workflow_dispatch:
inputs:
tag:
description: "image tag prefix"
default: "rc"
required: true
permissions:
contents: write # needed to write releases
id-token: write # needed for keyless signing
packages: write # needed for ghcr access
env:
CONTAINER_IMAGE: ghcr.io/nex-health/passenger-exporter
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare
id: prep
run: |
VERSION="${{ github.event.inputs.tag }}-${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
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: nexerbot
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: make build
- name: Generate images meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.CONTAINER_IMAGE }}
tags: |
type=raw,value=${{ steps.prep.outputs.VERSION }}
- name: Build and tag image
id: build
uses: docker/build-push-action@v5
with:
push: true
sbom: true
provenance: true
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- uses: sigstore/cosign-installer@v3
- name: Sign images
env:
COSIGN_EXPERIMENTAL: 1
run: |
cosign sign --yes ${{ env.CONTAINER_IMAGE }}:${{ steps.prep.outputs.VERSION }}
- name: Generate release notes
if: startsWith(github.ref, 'refs/tags/v')
run: |
mkdir -p release
echo '[CHANGELOG](https://github.com/nex-health/passenger-exporter/blob/main/CHANGELOG.md)' > ./release/notes.md
- uses: anchore/sbom-action/download-syft@v0.15.5
- name: Create release and SBOM
if: startsWith(github.ref, 'refs/tags/v')
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --release-notes=release/notes.md --rm-dist --skip-validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}