-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (46 loc) · 1.35 KB
/
release-binaries.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
53
54
---
name: Release binaries
"on":
push:
tags:
- "v*"
jobs:
release:
name: "Release for ${{ matrix.os }}-${{ matrix.arch }}"
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
arch: [amd64, arm64]
os: [linux, darwin]
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: 0
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
- name: Check out code
uses: actions/checkout@v2
with:
ref: ${{ inputs.tag }}
- name: Build binary
run: go build -o dist/candles-api-${{ matrix.os }}-${{ matrix.arch }} ./main.go
- name: Bundle binary in archive
uses: thedoctor0/zip-release@master
with:
type: zip
directory: dist
filename: candles-api-${{ matrix.os }}-${{ matrix.arch }}.zip
- name: Release
uses: softprops/action-gh-release@v1
with:
files: dist/*.zip
name: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}