-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (77 loc) · 2.23 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Based on https://github.com/badboy/mdbook-toc/blob/main/.github/workflows/deploy.yml
name: Release binaries
concurrency:
group: release
cancel-in-progress: true
env:
REPO_NAME: schemgo
on:
push:
tags:
- "v*"
# branches:
# - main
jobs:
github_build:
name: Build binaries
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- x86_64-apple-darwin
- aarch64-apple-darwin
- x86_64-pc-windows-msvc
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
name: x86_64-unknown-linux-gnu.tar.gz
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
name: x86_64-unknown-linux-musl.tar.gz
- target: x86_64-apple-darwin
os: macOS-latest
name: x86_64-apple-darwin.tar.gz
- target: aarch64-apple-darwin
os: macOS-latest
name: aarch64-apple-darwin.tar.gz
- target: x86_64-pc-windows-msvc
os: windows-latest
name: x86_64-pc-windows-msvc.zip
runs-on: ${{ matrix.os }}
steps:
- name: Setup | Checkout
uses: actions/checkout@v4
- name: Setup | Go
uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Build
run: go build -ldflags "-s -w" -o build/${{ env.REPO_NAME }}-${{ matrix.target }}
- name: Post Setup | Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.REPO_NAME }}-${{ matrix.target }}
path: build/*
github_release:
name: Create GitHub Release
needs: github_build
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v4
- name: Setup | Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/.
- run: tree
- name: Setup | Generate release notes
run: git log -1 --pretty='%s' > RELEASE.md
- name: Build | Publish
uses: softprops/action-gh-release@v2
with:
files: artifacts/**
body_path: RELEASE.md