-
Notifications
You must be signed in to change notification settings - Fork 21
65 lines (61 loc) · 2.01 KB
/
release.yaml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
##
## This GitHub Action is used to release a new version of Furiko.
##
## The Action is run whenever a new tag is pushed, and will perform the following:
##
## - Build artifacts for each platform
## - Create a GitHub Release
## - Push new container image tags
##
## The release process is currently done with GoReleaser: https://goreleaser.com/
##
name: Release new version
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Determine Go version from go.mod
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Set up Docker Buildx
id: docker-buildx
uses: docker/setup-buildx-action@v2
with:
platforms: |
linux/amd64
linux/arm
linux/arm64
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run goreleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# NOTE(irvinlim): If we don't specify this, then GoReleaser uses the "default" buildx
# instance with --builder=default, which doesn't add other architectures by default.
# We will pass this to the `docker buildx --builder=` command in GoReleaser.
DOCKER_BUILDX_INSTANCE: ${{ steps.docker-buildx.outputs.name }}