-
Notifications
You must be signed in to change notification settings - Fork 115
44 lines (44 loc) · 1.37 KB
/
Copy pathrelease.yml
File metadata and controls
44 lines (44 loc) · 1.37 KB
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
name: Build and Release Go Binaries
on:
release:
types: [created]
jobs:
build:
name: Build and Publish
strategy:
fail-fast: false
matrix:
os: [darwin, windows, linux]
arch: [arm64, amd64]
include:
- os: windows
extension: .exe
permissions:
contents: write
actions: write
id-token: write
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24"
- name: Get release version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Build binaries
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
run: |
go build -ldflags="-X 'main.Version=$VERSION'" -o release/jjui-$VERSION-${{ matrix.os }}-${{ matrix.arch }}${{matrix.extension}} cmd/jjui/main.go
zip -j release/jjui-$VERSION-${{ matrix.os }}-${{ matrix.arch }}.zip release/jjui-$VERSION-${{ matrix.os }}-${{ matrix.arch }}${{matrix.extension}}
- name: Upload release binaries
uses: softprops/action-gh-release@v2
with:
files: release/*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}