-
Notifications
You must be signed in to change notification settings - Fork 1
168 lines (138 loc) · 4.51 KB
/
go.yml
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: build
on: [push]
jobs:
build_linux:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build for linux
run: make docker-build-linux
- name: Upload binary artifact
uses: actions/upload-artifact@v3
with:
name: katzen
path: ./katzen
build_other_linuxes:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build for linux (alpine)
run: make distro=alpine docker-build-linux
- name: Upload binary artifact
uses: actions/upload-artifact@v3
with:
name: katzen.alpine
path: ./katzen
- name: Build for Nix
run: make docker-build-nix
- name: Save output artifact name
run: ls nix_build | head -1 > nixos.output
- name: Upload binary artifact
uses: actions/upload-artifact@v3
with:
name: nixos.output
path: nixos.output
build_windows:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build for windows
run: make docker-build-windows
- name: Upload binary artifact
uses: actions/upload-artifact@v3
with:
name: katzen.exe
path: ./katzen.exe
build_macos:
strategy:
matrix:
go-version: [1.19.x]
os: [macos-12]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
- name: Build for MacOS (amd64)
run: CGO_CFLAGS_ALLOW="-DPARAMS=sphincs-shake-256f" CGO_ENABLED=1 GOOS="darwin" GOARCH="amd64" go build -trimpath -ldflags=-buildid= -tags dynamic -o katzen-macos-amd64
- name: Build for MacOS (arm64)
run: CGO_CFLAGS_ALLOW="-DPARAMS=sphincs-shake-256f" CGO_ENABLED=1 GOOS="darwin" GOARCH="arm64" go build -trimpath -ldflags=-buildid= -tags dynamic -o katzen-macos-arm64
- name: Upload binary artifact
uses: actions/upload-artifact@v3
with:
name: katzen-macos-amd64
path: ./katzen-macos-amd64
- name: Upload binary artifact
uses: actions/upload-artifact@v3
with:
name: katzen-macos-arm64
path: ./katzen-macos-arm64
build_android:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build for android
run: make KEYSTORE=reproducible.keystore KEYPASS=reproducible docker-build-android
- name: Upload binary artifact
uses: actions/upload-artifact@v3
with:
name: katzen.apk
path: ./katzen.apk
create_release:
runs-on: ubuntu-22.04
needs: [build_linux, build_other_linuxes, build_windows, build_macos, build_android]
steps:
- name: Download katzen linux
uses: actions/download-artifact@v3
with:
name: katzen
- name: Download katzen windows
uses: actions/download-artifact@v3
with:
name: katzen.exe
- name: Download katzen android
uses: actions/download-artifact@v3
with:
name: katzen.apk
- name: Download katzen macos
uses: actions/download-artifact@v3
with:
name: katzen-macos-amd64
- name: Download katzen macos
uses: actions/download-artifact@v3
with:
name: katzen-macos-arm64
- name: Download nixos output name
uses: actions/download-artifact@v3
with:
name: nixos.output
- name: Hash and commit
run: |
sha256sum katzen katzen.apk katzen-macos-arm64 katzen-macos-amd64 katzen.exe > katzen.sha256
echo -n "# the nixos output was: " >> katzen.sha256
cat nixos.output >> katzen.sha256
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: test_${{ github.sha}}
release_name: Testing ${{ github.sha}}
prerelease: true
- name: Upload katzen.sha256
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./katzen.sha256
asset_name: katzen.sha256
asset_content_type: text/plain