-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (55 loc) · 1.89 KB
/
Copy pathrelease.yml
File metadata and controls
67 lines (55 loc) · 1.89 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
jobs:
build-and-release:
name: Build and Release Binaries
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Get version information
id: version
run: |
echo "version=$(make version)" >> $GITHUB_OUTPUT
echo "build_date=$(make get-build-date)" >> $GITHUB_OUTPUT
- name: Build binaries for multiple platforms
env:
VERSION: ${{ steps.version.outputs.version }}
BUILD_DATE: ${{ steps.version.outputs.build_date }}
run: |
LDFLAGS="-X main.version=${VERSION} -X main.buildDate=${BUILD_DATE}"
# Linux amd64
GOOS=linux GOARCH=amd64 go build -ldflags "${LDFLAGS}" -o roxie-linux-amd64 ./cmd
# Linux arm64
GOOS=linux GOARCH=arm64 go build -ldflags "${LDFLAGS}" -o roxie-linux-arm64 ./cmd
# macOS amd64
GOOS=darwin GOARCH=amd64 go build -ldflags "${LDFLAGS}" -o roxie-darwin-amd64 ./cmd
# macOS arm64
GOOS=darwin GOARCH=arm64 go build -ldflags "${LDFLAGS}" -o roxie-darwin-arm64 ./cmd
# Generate checksums
sha256sum roxie-* > checksums.txt
- name: Create GitHub Release
uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3.0.1
with:
name: Release ${{ steps.version.outputs.version }}
draft: false
prerelease: false
generate_release_notes: true
files: |
roxie-linux-amd64
roxie-linux-arm64
roxie-darwin-amd64
roxie-darwin-arm64
checksums.txt