-
Notifications
You must be signed in to change notification settings - Fork 40
54 lines (47 loc) · 1.69 KB
/
release.yaml
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
name: Generate Release Artifacts
on:
release:
types:
- created
permissions:
contents: write
checks: write
actions: read
issues: read
packages: write
pull-requests: read
repository-projects: read
statuses: read
jobs:
generate:
name: Generate Release Artifacts
runs-on: macos-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.21.5'
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v1
with:
version: 0.9.1
- name: Get the version
id: get_version
run: echo VERSION=$(echo $GITHUB_REF | cut -d / -f 3) >> $GITHUB_OUTPUT
- name: Build
run: |
npm install -g typescript
mkdir dist
go generate ./...
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 CC="zig cc -target x86_64-linux-musl" CXX="zig c++ -target x86_64-linux-musl" go build --tags extended -o dist/klotho_linux_amd64 -ldflags="-X 'main.Version=${{ steps.get_version.outputs.VERSION }}' -s -w" ./cmd/klotho
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build --tags extended -o dist/klotho_darwin_amd64 -ldflags="-X 'main.Version=${{ steps.get_version.outputs.VERSION }}' -s -w" ./cmd/klotho
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build --tags extended -o dist/klotho_darwin_arm64 -ldflags="-X 'main.Version=${{ steps.get_version.outputs.VERSION }}' -s -w" ./cmd/klotho
chmod +x dist
- name: Upload build-artifacts
uses: alexellis/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["dist/*"]'