Skip to content

Commit 02be52e

Browse files
committed
Merge branch 'ghrc_to_docker'
2 parents f8df12d + eb58798 commit 02be52e

File tree

3 files changed

+32
-65
lines changed

3 files changed

+32
-65
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,23 @@ jobs:
1313
setup-env:
1414
runs-on: ubuntu-22.04
1515
outputs:
16-
ci_image: ${{ steps.set-ci-image.outputs.ci_image }}
16+
ci_image_version: ${{ steps.set-ci-image-version.outputs.ci_image_version }}
1717
steps:
1818
- name: Clone the repo
1919
uses: actions/checkout@v4
2020

2121
- name: Read CI Image Version
22-
id: set-ci-image
22+
id: set-ci-image-version
2323
run: |
24-
# Use alternative image when running on GitHub workflows CI to avoid potential
25-
# rate limiting when executing jobs in parallel: they can't cache docker images
26-
# and always pull.
27-
#
28-
# To update this image, generate a personal token with write:packages scope
29-
# on https://github.com/settings/tokens and authenticate yourself locally with
30-
# "docker login ghcr.io -u <github-username>" using the
31-
# newly generated token as password.
32-
# Once logged in, tag an new image:
33-
# docker tag shiftcrypto/bitbox-wallet-app:VERSION \
34-
# ghcr.io/bitboxswiss/bitbox-wallet-app-ci:VERSION
35-
# and push as usual:
36-
# docker push ghcr.io/bitboxswiss/bitbox-wallet-app-ci:VERSION
37-
# Lastly, update the next line to use the newly pushed image version.
38-
# See docs for more details:
39-
# https://docs.github.com/en/packages/guides/pushing-and-pulling-docker-images
40-
#
4124
# Keep this in sync with default in scripts/github-ci.sh.
4225
CI_IMAGE_VERSION=$(cat .containerversion)
43-
echo "ci_image=ghcr.io/bitboxswiss/bitbox-wallet-app-ci:$CI_IMAGE_VERSION" >> $GITHUB_OUTPUT
26+
echo "ci_image_version=$CI_IMAGE_VERSION" >> $GITHUB_OUTPUT
4427
4528
test-lint:
4629
runs-on: ubuntu-22.04
4730
needs: setup-env
31+
container:
32+
image: shiftcrypto/bitbox-wallet-app:${{ needs.setup-env.outputs.ci_image_version }}
4833
steps:
4934
- name: Clone the repo
5035
with:
@@ -56,13 +41,14 @@ jobs:
5641
run: ./scripts/github-ci.sh ci
5742
env:
5843
OS_NAME: linux
59-
CI_IMAGE: ${{ needs.setup-env.outputs.ci_image }}
6044

6145
android:
6246
runs-on: ubuntu-22.04
6347
needs: setup-env
6448
outputs:
6549
artifact-url: ${{ steps.upload.outputs.artifact-url }}
50+
container:
51+
image: shiftcrypto/bitbox-wallet-app:${{ needs.setup-env.outputs.ci_image_version }}
6652
steps:
6753
- name: Clone the repo
6854
uses: actions/checkout@v4
@@ -77,17 +63,18 @@ jobs:
7763
run: ./scripts/github-ci.sh android
7864
env:
7965
OS_NAME: linux
80-
CI_IMAGE: ${{ needs.setup-env.outputs.ci_image }}
8166
- name: Upload APK
8267
id: upload
8368
uses: actions/upload-artifact@v4
8469
with:
85-
path: frontends/android/BitBoxApp/app/build/outputs/apk/debug/app-debug.apk
70+
path: /github/home/go/src/github.com/BitBoxSwiss/bitbox-wallet-app/frontends/android/BitBoxApp/app/build/outputs/apk/debug/app-debug.apk
8671
name: BitBoxApp-android-${{github.sha}}.apk
8772
if-no-files-found: error
8873
qt-linux:
8974
runs-on: ubuntu-22.04
9075
needs: setup-env
76+
container:
77+
image: shiftcrypto/bitbox-wallet-app:${{ needs.setup-env.outputs.ci_image_version }}
9178
outputs:
9279
artifact-url-ai: ${{ steps.upload-ai.outputs.artifact-url }}
9380
artifact-url-deb: ${{ steps.upload-deb.outputs.artifact-url }}
@@ -101,26 +88,25 @@ jobs:
10188
run: ./scripts/github-ci.sh qt-linux
10289
env:
10390
OS_NAME: linux
104-
CI_IMAGE: ${{ needs.setup-env.outputs.ci_image }}
10591
- name: Upload AppImage
10692
id: upload-ai
10793
uses: actions/upload-artifact@v4
10894
with:
109-
path: frontends/qt/build/linux/BitBoxApp-*.AppImage
95+
path: /github/home/go/src/github.com/BitBoxSwiss/bitbox-wallet-app/frontends/qt/build/linux/BitBoxApp-*.AppImage
11096
name: BitBoxApp-linux-${{github.sha}}.AppImage
11197
if-no-files-found: error
11298
- name: Upload deb
11399
id: upload-deb
114100
uses: actions/upload-artifact@v4
115101
with:
116-
path: frontends/qt/build/linux/bitbox_*.deb
102+
path: /github/home/go/src/github.com/BitBoxSwiss/bitbox-wallet-app/frontends/qt/build/linux/bitbox_*.deb
117103
name: BitBoxApp-linux-${{github.sha}}.deb
118104
if-no-files-found: error
119105
- name: Upload rpm
120106
id: upload-rpm
121107
uses: actions/upload-artifact@v4
122108
with:
123-
path: frontends/qt/build/linux/bitbox-*.rpm
109+
path: /github/home/go/src/github.com/BitBoxSwiss/bitbox-wallet-app/frontends/qt/build/linux/bitbox-*.rpm
124110
name: BitBoxApp-linux-${{github.sha}}.rpm
125111
if-no-files-found: error
126112
macos:

frontends/qt/Makefile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ linux:
3737
# Exclude libwayland-client.so.0, see https://github.com/AppImageCommunity/pkg2appimage/commit/15a64c20dc23a0154622ba25829364323903b6b5,
3838
# but that is yet in the default exclusion lib of linuxdeployqt.
3939
# See also: https://github.com/probonopd/linuxdeployqt/issues/631 - we can remove the libwayland-client.so.0 exclusion once this is merged and we updated our linuxdeployqt binary.
40-
cd build/linux-tmp && /opt/linuxdeployqt-continuous-x86_64.AppImage BitBox \
41-
-bundle-non-qt-libs \
42-
-unsupported-allow-new-glibc \
43-
-extra-plugins=platforms/libqwayland-generic.so,platforms/libqwayland-egl.so,wayland-graphics-integration-client,wayland-decoration-client,wayland-shell-integration \
44-
-exclude-libs=libwayland-client.so.0
40+
cd build/linux-tmp && \
41+
/opt/linuxdeployqt-continuous-x86_64.AppImage --appimage-extract && \
42+
./squashfs-root/AppRun BitBox \
43+
-bundle-non-qt-libs \
44+
-unsupported-allow-new-glibc \
45+
-extra-plugins=platforms/libqwayland-generic.so,platforms/libqwayland-egl.so,wayland-graphics-integration-client,wayland-decoration-client,wayland-shell-integration \
46+
-exclude-libs=libwayland-client.so.0
4547
cp /usr/lib/x86_64-linux-gnu/nss/* build/linux-tmp/lib
4648
# See https://github.com/probonopd/linuxdeployqt/issues/554#issuecomment-1761834180
4749
cp "$(shell qmake -query QT_INSTALL_DATA)/resources/v8_context_snapshot.bin" build/linux-tmp/resources
@@ -53,8 +55,11 @@ linux:
5355
cd build/linux && fpm --after-install ../../resources/deb-afterinstall.sh -s dir -t deb -n bitbox -v 4.48.0 -C ../tmp-deb/
5456
cd build/linux && fpm --after-install ../../resources/deb-afterinstall.sh -s dir -t rpm -n bitbox -v 4.48.0 -C ../tmp-deb/
5557
# create AppImage
56-
cd build/linux-tmp && /opt/linuxdeployqt-continuous-x86_64.AppImage BitBox -appimage -unsupported-allow-new-glibc
57-
mv build/linux-tmp/BitBoxApp-*-x86_64.AppImage build/linux/
58+
cd build/linux-tmp && \
59+
./squashfs-root/AppRun BitBox \
60+
-appimage \
61+
-unsupported-allow-new-glibc
62+
mv build/linux-tmp/BitBoxApp*-x86_64.AppImage build/linux/
5863
osx:
5964
$(MAKE) clean
6065
cd server && $(MAKE) macosx

scripts/github-ci.sh

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,15 @@
11
#!/bin/bash -eux
2-
32
# Which make target to run.
43
WHAT="$1"
54
# Because we need to compile some Go code without modules,
65
# the source must be placed in a specific directory as expected by Go.
76
# The path is relative to GOPATH.
87
GO_SRC_DIR=src/github.com/BitBoxSwiss/bitbox-wallet-app
98

10-
# The following is executed only on linux machines.
11-
if [ "$OS_NAME" == "linux" ]; then
12-
# Which docker image to use to run the CI. Defaults to Docker Hub.
13-
# Overwrite with CI_IMAGE=docker/image/path environment variable.
14-
# Keep this in sync with .github/workflows/ci.yml.
15-
: "${CI_IMAGE:=shiftcrypto/bitbox-wallet-app:$(cat .containerversion)}"
16-
# Time image pull to compare in the future.
17-
time docker pull "$CI_IMAGE"
18-
19-
# .gradle dir is mapped to preserve cache.
20-
#
21-
# safe.directory is added due to "unsafe repository (REPO is owned by someone else)" in GitHub
22-
# CI (https://github.com/actions/checkout/issues/760)
23-
docker run --privileged \
24-
-v $HOME/.gradle:/root/.gradle \
25-
-v ${GITHUB_BUILD_DIR}:/root/go/${GO_SRC_DIR}/ \
26-
-i "${CI_IMAGE}" \
27-
bash -c "git config --global --add safe.directory \$(go env GOPATH)/${GO_SRC_DIR} && make -C \$(go env GOPATH)/${GO_SRC_DIR} ${WHAT}"
28-
fi
29-
30-
# The following is executed only on macOS machines.
31-
if [ "$OS_NAME" == "osx" ]; then
32-
# GitHub CI installs Go and Qt directly in the macos action, before executing
33-
# this script.
34-
go version
35-
export PATH="~/go/bin:$PATH"
36-
mkdir -p $(go env GOPATH)/$(dirname $GO_SRC_DIR)
37-
cp -a ../bitbox-wallet-app $(go env GOPATH)/$(dirname $GO_SRC_DIR)
38-
make -C $(go env GOPATH)/$GO_SRC_DIR "$WHAT"
39-
fi
9+
go version
10+
export PATH="~/go/bin:$PATH"
11+
# export GOFLAGS="-buildvcs=false" # Disable VCS stamping cleanly for all go commands
12+
mkdir -p $(go env GOPATH)/$(dirname $GO_SRC_DIR)
13+
cp -a ../bitbox-wallet-app $(go env GOPATH)/$(dirname $GO_SRC_DIR)
14+
git config --global --add safe.directory $(go env GOPATH)/${GO_SRC_DIR}
15+
make -C $(go env GOPATH)/$GO_SRC_DIR "$WHAT"

0 commit comments

Comments
 (0)