forked from BitBoxSwiss/bitbox-wallet-app
-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (153 loc) · 5.07 KB
/
ci.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
# See reference docs at
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: ci
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
# Use alternative image when running on GitHub workflows CI to avoid potential
# rate limiting when executing jobs in parallel: they can't cache docker images
# and always pull.
#
# To update this image, generate a personal token with write:packages scope
# on https://github.com/settings/tokens and authenticate yourself locally with
# "docker login ghcr.io -u <github-username>" using the
# newly generated token as password.
# Once logged in, tag an new image:
# docker tag shiftcrypto/bitbox-wallet-app:VERSION \
# ghcr.io/bitboxswiss/bitbox-wallet-app-ci:VERSION
# and push as usual:
# docker push ghcr.io/bitboxswiss/bitbox-wallet-app-ci:VERSION
# Lastly, update the next line to use the newly pushed image version.
# See docs for more details:
# https://docs.github.com/en/packages/guides/pushing-and-pulling-docker-images
#
# Keep this in sync with default in scripts/github-ci.sh.
CI_IMAGE: ghcr.io/bitboxswiss/bitbox-wallet-app-ci:24
GITHUB_BUILD_DIR: ${{github.workspace}}
jobs:
test-lint:
runs-on: ubuntu-22.04
steps:
- name: Clone the repo
with:
submodules: recursive
uses: actions/checkout@v4
- name: Run CI script
# The script also runs golang-ci but it's ok: doesn't take too long and may be useful
# to keep its linter errors in this log, too.
run: ./scripts/github-ci.sh ci
env:
OS_NAME: linux
android:
runs-on: ubuntu-22.04
steps:
- name: Clone the repo
uses: actions/checkout@v4
- name: Enable caching
uses: actions/cache@v4
with:
key: ${{runner.os}}-android
path: |
~/.gradle/caches
~/.gradle/wrapper
- name: Build Android
run: ./scripts/github-ci.sh android
env:
OS_NAME: linux
- name: Upload APK
uses: actions/upload-artifact@v4
with:
path: frontends/android/BitBoxApp/app/build/outputs/apk/debug/app-debug.apk
name: BitBoxApp-android-${{github.sha}}.apk
qt-linux:
runs-on: ubuntu-22.04
steps:
- name: Clone the repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build Qt-Linux
run: ./scripts/github-ci.sh qt-linux
env:
OS_NAME: linux
- name: Upload AppImage
uses: actions/upload-artifact@v4
with:
path: frontends/qt/build/linux/BitBoxApp-*.AppImage
name: BitBoxApp-linux-${{github.sha}}.AppImage
- name: Upload deb
uses: actions/upload-artifact@v4
with:
path: frontends/qt/build/linux/bitbox_*.deb
name: BitBoxApp-linux-${{github.sha}}.deb
- name: Upload rpm
uses: actions/upload-artifact@v4
with:
path: frontends/qt/build/linux/bitbox-*.rpm
name: BitBoxApp-linux-${{github.sha}}.rpm
macos:
runs-on: macos-12
steps:
- name: Clone the repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Build macOS app
run: >
./scripts/github-ci.sh qt-osx;
env:
OS_NAME: osx
- name: Archive app
run: >
pushd ~/go/src/github.com/BitBoxSwiss/bitbox-wallet-app/frontends/qt/build/osx;
ditto -c -k --keepParent BitBox.app ${{github.workspace}}/BitBoxApp-macos.zip;
popd;
- name: Upload app
uses: actions/upload-artifact@v4
with:
path: BitBoxApp-macos.zip
name: BitBoxApp-macos-${{github.sha}}.zip
ios:
runs-on: macos-14
env:
GO_SRC_DIR: src/github.com/BitBoxSwiss/bitbox-wallet-app
steps:
- name: Clone the repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Go
uses: actions/setup-go@v5
with:
# Take Go version to install from go.mod.
go-version-file: 'go.mod'
- name: Set GOPATH
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
- name: Copy repo to GOPATH
# This is needed as gomobile is still unaware of go modules, so the repo must be in GOPATH
run: |
mkdir -p $GOPATH/$(dirname $GO_SRC_DIR)
cp -a ${{github.workspace}} $GOPATH/$(dirname $GO_SRC_DIR)
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Install Qt
run: |
brew install qt@5
echo "/opt/homebrew/opt/qt@5/bin" >> $GITHUB_PATH
- name: Build iOS app
run: |
make gomobileinit
(cd $GOPATH/$GO_SRC_DIR; make ios)