Skip to content

Merge pull request #1659 from cloudflare/prom #4154

Merge pull request #1659 from cloudflare/prom

Merge pull request #1659 from cloudflare/prom #4154

Workflow file for this run

name: Compile
on:
push:
branches:
- main
tags:
- "*"
pull_request:
branches:
- main
release:
types:
- published
permissions:
contents: write
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
show-progress: false
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version-file: go.ver
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- name: Docker Login
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Test releasing binaries
if: github.event_name == 'pull_request'
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
with:
args: release --clean --skip=validate --skip=sign --skip=sbom --skip=publish --snapshot
- name: Extract release changelog
if: startsWith(github.ref, 'refs/tags/')
id: changelog
uses: sean0x42/markdown-extract@4178293dd16a52514b6cb2c01f4d309d264b2736 # v2
with:
file: docs/changelog.md
pattern: "${{ github.ref_name }}"
no-print-matched-heading: true
- name: Write changelog
if: startsWith(github.ref, 'refs/tags/')
run: |
mkdir .tmp
exec 3<<'HERE'
${{ steps.changelog.outputs.markdown }}
HERE
cat /dev/fd/3 | tee .tmp/changelog.txt
- name: Release binaries
if: startsWith(github.ref, 'refs/tags/')
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
with:
args: release --clean --release-notes=.tmp/changelog.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}