forked from trezor/trezord-go
-
Notifications
You must be signed in to change notification settings - Fork 13
222 lines (195 loc) · 9.23 KB
/
release.yml
File metadata and controls
222 lines (195 loc) · 9.23 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
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
name: Build Release Package
on:
workflow_dispatch:
jobs:
release-linux:
name: "release-linux"
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Populate vars
id: vars
run: |
echo "build_date=$(date +"%Y%m%d")" >> $GITHUB_OUTPUT
echo "short_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "artifacts_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"" >> $GITHUB_OUTPUT
echo "bridge_version=$(cat VERSION)" >> $GITHUB_OUTPUT
echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
- name: Install Dependencies Common
run: |
sudo apt update
sudo apt install -y --no-install-recommends golang
sudo apt install -y ruby-dev rpm tar xz-utils
sudo gem i fpm -f --no-document
- name: Install Dependencies X86 X64
run: |
sudo apt install -y --no-install-recommends gcc-multilib
- name: Build X86 X64
run: |
export CGO_ENABLED=1 GOOS=linux GOARCH=amd64 CC="gcc"
go build -ldflags="-X 'main.version=$VERSION'" -v -o "onekeyd_${GOOS}_${GOARCH}" .
export CGO_ENABLED=1 GOOS=linux GOARCH=386 CC="gcc"
go build -ldflags="-X 'main.version=$VERSION'" -v -o "onekeyd_${GOOS}_i${GOARCH}" .
- name: Install Dependencies ARM (could not coexist with gcc-multilib)
run: |
sudo apt install -y --no-install-recommends gcc-aarch64-linux-gnu g++-aarch64-linux-gnu cpp-aarch64-linux-gnu binutils-aarch64-linux-gnu
sudo apt install -y --no-install-recommends gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf cpp-arm-linux-gnueabihf binutils-arm-linux-gnueabihf
sudo apt install -y --no-install-recommends gcc-arm-linux-gnueabi g++-arm-linux-gnueabi cpp-arm-linux-gnueabi binutils-arm-linux-gnueabi
- name: Build ARM
run: |
export CGO_ENABLED=1 GOOS=linux GOARCH=arm64 CC="aarch64-linux-gnu-gcc"
go build -ldflags="-X 'main.version=$VERSION'" -v -o "onekeyd_${GOOS}_${GOARCH}" .
export CGO_ENABLED=1 GOOS=linux GOARCH=arm CC="arm-linux-gnueabihf-gcc"
go build -ldflags="-X 'main.version=$VERSION'" -v -o "onekeyd_${GOOS}_${GOARCH}hf" .
export CGO_ENABLED=1 GOOS=linux GOARCH=arm CC="arm-linux-gnueabi-gcc"
go build -ldflags="-X 'main.version=$VERSION'" -v -o "onekeyd_${GOOS}_${GOARCH}" .
- name: Build packages
run: |
mv onekeyd_linux_* release/linux/input_files/
cd release/linux/
chmod +x build.sh
./build.sh
cd ../../
- name: Move and zip artifacts
run: |
mkdir artifacts
mv release/linux/output/* artifacts/
# zip -rj artifacts.zip artifacts/*
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: "${{ github.event.repository.name }}-${{ steps.vars.outputs.bridge_version }}-${{ steps.vars.outputs.build_date }}-${{ steps.vars.outputs.short_hash }}-release-packages"
path: |
artifacts/*
# - name: Notify to Slack
# uses: onekeyhq/actions/notice-slack-app-update@main
# with:
# web-hook-url: ${{ secrets.SLACK_DEV_RELEASE_WEBHOOK }}
# artifact-type: TOUCH-FIRMWARE-BT
# artifact-name: Touch-Hardware-Firmware-BT
# artifact-bundle-id: "so.onekey.firmware.touch.bt"
# artifact-version-name: "${{ steps.vars.outputs.bridge_version }}"
# artifact-version-code: "${{ steps.vars.outputs.short_hash }}"
# artifact-download-url: "${{ steps.vars.outputs.artifacts_url }}"
# change-log: "Download [Artifacts] at the bottom of page."
# custom-issue-url: ""
# custom-message-title: ""
# custom-message-payload: ""
# filter-code: false
release-windows:
name: "release-windows"
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Populate vars
id: vars
run: |
echo "build_date=$(date +"%Y%m%d")" >> $GITHUB_OUTPUT
echo "short_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "artifacts_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"" >> $GITHUB_OUTPUT
echo "bridge_version=$(cat VERSION)" >> $GITHUB_OUTPUT
echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
- name: Install Dependencies
run: |
sudo apt update
sudo apt install -y --no-install-recommends build-essential wget msitools dos2unix libtool nsis
sudo apt install -y --no-install-recommends gcc-multilib
sudo apt install -y --no-install-recommends gcc-mingw-w64 g++-mingw-w64 binutils-mingw-w64 mingw-w64-common mingw-w64-i686-dev mingw-w64-x86-64-dev
sudo apt install -y --no-install-recommends automake autoconf autotools-dev autoconf-archive
- name: Build
run: |
export CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CC="x86_64-w64-mingw32-gcc"
go build -ldflags="-H windowsgui -X 'main.version=$VERSION'" -v -o "onekeyd_${GOOS}_${GOARCH}.exe" .
export CGO_ENABLED=1 GOOS=windows GOARCH=386 CC="i686-w64-mingw32-gcc"
go build -ldflags="-H windowsgui -X 'main.version=$VERSION'" -v -o "onekeyd_${GOOS}_i${GOARCH}.exe" .
- name: Build packages
run: |
mv onekeyd_windows_* release/windows/input_files/
cd release/windows/
chmod +x build.sh
./build.sh
cd ../../
- name: Move and zip artifacts
run: |
mkdir artifacts
mv release/windows/output/onekey-bridge-* artifacts/
# zip -rj artifacts.zip artifacts/*
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: "${{ github.event.repository.name }}-${{ steps.vars.outputs.bridge_version }}-${{ steps.vars.outputs.build_date }}-${{ steps.vars.outputs.short_hash }}-release-packages"
path: |
artifacts/*
# - name: Notify to Slack
# uses: onekeyhq/actions/notice-slack-app-update@main
# with:
# web-hook-url: ${{ secrets.SLACK_DEV_RELEASE_WEBHOOK }}
# artifact-type: TOUCH-FIRMWARE-BT
# artifact-name: Touch-Hardware-Firmware-BT
# artifact-bundle-id: "so.onekey.firmware.touch.bt"
# artifact-version-name: "${{ steps.vars.outputs.bridge_version }}"
# artifact-version-code: "${{ steps.vars.outputs.short_hash }}"
# artifact-download-url: "${{ steps.vars.outputs.artifacts_url }}"
# change-log: "Download [Artifacts] at the bottom of page."
# custom-issue-url: ""
# custom-message-title: ""
# custom-message-payload: ""
# filter-code: false
release-macos:
name: "release-macos"
runs-on: macos-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Populate vars
id: vars
run: |
echo "build_date=$(date +"%Y%m%d")" >> $GITHUB_OUTPUT
echo "short_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "artifacts_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"" >> $GITHUB_OUTPUT
echo "bridge_version=$(cat VERSION)" >> $GITHUB_OUTPUT
echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
# - name: Install Dependencies
# run: |
# # not needed
- name: Build
run: |
export CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 CC=""
go build -ldflags="-X 'main.version=$VERSION'" -v -o "onekeyd_${GOOS}_${GOARCH}" .
export CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 CC=""
go build -ldflags="-X 'main.version=$VERSION'" -v -o "onekeyd_${GOOS}_${GOARCH}" .
- name: Build packages
run: |
cp onekeyd_darwin_* release/macos/input_files/
cd release/macos
chmod +x build.sh
./build.sh
cd ../../
- name: Move and zip artifacts
run: |
mkdir artifacts
mv release/macos/output/* artifacts/
# zip -rj artifacts.zip artifacts/*
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: "${{ github.event.repository.name }}-${{ steps.vars.outputs.bridge_version }}-${{ steps.vars.outputs.build_date }}-${{ steps.vars.outputs.short_hash }}-release-packages"
path: |
artifacts/*
# - name: Notify to Slack
# uses: onekeyhq/actions/notice-slack-app-update@main
# with:
# web-hook-url: ${{ secrets.SLACK_DEV_RELEASE_WEBHOOK }}
# artifact-type: TOUCH-FIRMWARE-BT
# artifact-name: Touch-Hardware-Firmware-BT
# artifact-bundle-id: "so.onekey.firmware.touch.bt"
# artifact-version-name: "${{ steps.vars.outputs.bridge_version }}"
# artifact-version-code: "${{ steps.vars.outputs.short_hash }}"
# artifact-download-url: "${{ steps.vars.outputs.artifacts_url }}"
# change-log: "Download [Artifacts] at the bottom of page."
# custom-issue-url: ""
# custom-message-title: ""
# custom-message-payload: ""
# filter-code: false