-
Notifications
You must be signed in to change notification settings - Fork 14
70 lines (61 loc) · 1.9 KB
/
Copy pathrelease.yml
File metadata and controls
70 lines (61 loc) · 1.9 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
68
69
70
name: Release Hypeman API
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
runs-on: [self-hosted, linux, x64, kvm]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
# Not necessary to upload cache on self-hosted runner(s)
# ~/go/pkg/mod and ~/.cache/go-build stay on disk between runs automatically.
cache: false
go-version: '1.25.4'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
# gorelease-pro is not required
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The macOS server links cgo against Virtualization.framework, so it can't be
# cross-compiled from the Linux release job — it builds on a macOS arm64 runner.
release-darwin:
needs: release
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25.4'
- name: Build server and token tool
run: |
make build-darwin
go build -o bin/hypeman-token ./cmd/gen-jwt
- name: Package and upload darwin_arm64 archive
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${GITHUB_REF_NAME#v}"
STAGE="$(mktemp -d)"
cp bin/hypeman "${STAGE}/hypeman-api"
cp bin/hypeman-token "${STAGE}/hypeman-token"
cp config.example.darwin.yaml "${STAGE}/"
ARCHIVE="hypeman_${VERSION}_darwin_arm64.tar.gz"
tar -czf "${ARCHIVE}" -C "${STAGE}" .
gh release upload "${GITHUB_REF_NAME}" "${ARCHIVE}" --clobber