-
Notifications
You must be signed in to change notification settings - Fork 53
52 lines (45 loc) · 1.08 KB
/
compile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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@v3
with:
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 }}