-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (62 loc) · 2.05 KB
/
release.yml
File metadata and controls
73 lines (62 loc) · 2.05 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
71
72
73
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build-darwin-vz:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- arch: arm64
target: arm64-apple-macosx13.0
- arch: amd64
target: x86_64-apple-macosx13.0
steps:
- uses: actions/checkout@v4
- name: Build cleanroom-darwin-vz
run: |
mkdir -p "release-extra/darwin_${{ matrix.arch }}"
xcrun swiftc -O -target "${{ matrix.target }}" -framework Virtualization \
cmd/cleanroom-darwin-vz/main.swift \
-o "release-extra/darwin_${{ matrix.arch }}/cleanroom-darwin-vz"
cp cmd/cleanroom-darwin-vz/entitlements.plist "release-extra/darwin_${{ matrix.arch }}/entitlements.plist"
- uses: actions/upload-artifact@v4
with:
name: darwin-vz-${{ matrix.arch }}
path: release-extra
release:
runs-on: ubuntu-latest
needs: build-darwin-vz
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: actions/download-artifact@v4
with:
name: darwin-vz-arm64
path: release-extra
- uses: actions/download-artifact@v4
with:
name: darwin-vz-amd64
path: release-extra
- name: Build release extra binaries
run: |
mkdir -p release-extra/linux_amd64 release-extra/linux_arm64
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" \
-o release-extra/linux_amd64/cleanroom-guest-agent ./cmd/cleanroom-guest-agent
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" \
-o release-extra/linux_arm64/cleanroom-guest-agent ./cmd/cleanroom-guest-agent
- uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}