Merge pull request #716 from cloudflare/dependabot/go_modules/tools/g… #1827
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
name: Compile | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "*" | |
pull_request: | |
branches: | |
- main | |
release: | |
types: | |
- published | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21.0 | |
cache: true | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Docker Login | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Compile binaries | |
uses: goreleaser/goreleaser-action@v4 | |
with: | |
args: build --snapshot --clean --single-target | |
- name: Release binaries | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: goreleaser/goreleaser-action@v4 | |
with: | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |