-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (41 loc) · 1.09 KB
/
release.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
name: Release
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
push:
# run only against tags
tags:
- 'v*'
create:
# run only against tags
tags:
- 'v*'
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages as well
permissions:
contents: write
pages: write
id-token: write
jobs:
binaries:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch Go version
run: |
GO_VERSION=$(perl -ne 'print "$1\n" if /FROM golang:([0-9.]+)/' Dockerfile | head -n1)
[ -n "$GO_VERSION" ] || exit 1
echo "go_version=$GO_VERSION" >> $GITHUB_ENV
- name: Setup Go environment
uses: actions/setup-go@v3
with:
go-version: "${{ env.go_version }}"
- name: Binaries Release
uses: goreleaser/goreleaser-action@v2.9.1
with:
version: ~> 1.5.0
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}