Skip to content

Commit

Permalink
[POC] Build Linux System package on aarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
rmartin16 committed Jul 31, 2023
1 parent f7a815a commit 1fd2b46
Show file tree
Hide file tree
Showing 3 changed files with 477 additions and 449 deletions.
4 changes: 4 additions & 0 deletions .github/actions/install-briefcase/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ inputs:
required: false

outputs:
installed-repo:
value: ${{ steps.install.outputs.repo }}
description: "The source repo of Briefcase that was installed."
installed-version:
value: ${{ steps.install.outputs.version }}
description: "The version or branch of Briefcase that was installed."
Expand Down Expand Up @@ -144,4 +147,5 @@ runs:
python -m pip install -U "git+${REPO}@${REF}"
echo "Installed version: $(briefcase --version)"
echo "repo=${REPO}" >> ${GITHUB_OUTPUT}
echo "version=${REF}" >> ${GITHUB_OUTPUT}
314 changes: 169 additions & 145 deletions .github/workflows/app-build-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ jobs:

- name: Install Briefcase
if: ${{ !endsWith(inputs.repository, 'briefcase') }}
id: briefcase
uses: ./beeware-.github/.github/actions/install-briefcase

- name: Create Briefcase project
Expand All @@ -147,53 +148,53 @@ jobs:
# In the steps below, using the builtin functions for comparison (instead of ==)
# allows for case-insensitivity to the inputs for the workflow.

- name: Build macOS app
if: >
startsWith(inputs.runner-os, 'macOS')
&& contains(fromJSON('["", "macOS"]'), inputs.target-platform)
&& contains(fromJSON('["", "app"]'), inputs.target-format)
run: |
cd tests/apps/verify-${{ inputs.framework }}
briefcase create macOS app
briefcase build macOS app
briefcase package macOS app --adhoc-sign
- name: Build macOS Xcode project
if: >
startsWith(inputs.runner-os, 'macOS')
&& contains(fromJSON('["", "macOS"]'), inputs.target-platform)
&& contains(fromJSON('["", "Xcode"]'), inputs.target-format)
run: |
cd tests/apps/verify-${{ inputs.framework }}
briefcase create macOS Xcode
briefcase build macOS Xcode
briefcase package macOS Xcode --adhoc-sign
- name: Build Windows app
if: >
startsWith(inputs.runner-os, 'Windows')
&& contains(fromJSON('["", "Windows"]'), inputs.target-platform)
&& contains(fromJSON('["", "app"]'), inputs.target-format)
run: |
unset WIX # force Briefcase to install and use its own version of WiX
cd tests/apps/verify-${{ inputs.framework }}
briefcase create windows app
briefcase build windows app
briefcase package windows app --adhoc-sign
- name: Build Windows Visual Studio project
if: >
startsWith(inputs.runner-os, 'Windows')
&& contains(fromJSON('["", "Windows"]'), inputs.target-platform)
&& contains(fromJSON('["", "VisualStudio"]'), inputs.target-format)
run: |
unset WIX # force Briefcase to install and use its own version of WiX
cd tests/apps/verify-${{ inputs.framework }}
briefcase create windows VisualStudio
briefcase build windows VisualStudio
briefcase package windows VisualStudio --adhoc-sign
# - name: Build macOS app
# if: >
# startsWith(inputs.runner-os, 'macOS')
# && contains(fromJSON('["", "macOS"]'), inputs.target-platform)
# && contains(fromJSON('["", "app"]'), inputs.target-format)
# run: |
# cd tests/apps/verify-${{ inputs.framework }}
# briefcase create macOS app
# briefcase build macOS app
# briefcase package macOS app --adhoc-sign
#
# - name: Build macOS Xcode project
# if: >
# startsWith(inputs.runner-os, 'macOS')
# && contains(fromJSON('["", "macOS"]'), inputs.target-platform)
# && contains(fromJSON('["", "Xcode"]'), inputs.target-format)
# run: |
# cd tests/apps/verify-${{ inputs.framework }}
# briefcase create macOS Xcode
# briefcase build macOS Xcode
# briefcase package macOS Xcode --adhoc-sign
#
# - name: Build Windows app
# if: >
# startsWith(inputs.runner-os, 'Windows')
# && contains(fromJSON('["", "Windows"]'), inputs.target-platform)
# && contains(fromJSON('["", "app"]'), inputs.target-format)
# run: |
# unset WIX # force Briefcase to install and use its own version of WiX
#
# cd tests/apps/verify-${{ inputs.framework }}
# briefcase create windows app
# briefcase build windows app
# briefcase package windows app --adhoc-sign
#
# - name: Build Windows Visual Studio project
# if: >
# startsWith(inputs.runner-os, 'Windows')
# && contains(fromJSON('["", "Windows"]'), inputs.target-platform)
# && contains(fromJSON('["", "VisualStudio"]'), inputs.target-format)
# run: |
# unset WIX # force Briefcase to install and use its own version of WiX
#
# cd tests/apps/verify-${{ inputs.framework }}
# briefcase create windows VisualStudio
# briefcase build windows VisualStudio
# briefcase package windows VisualStudio --adhoc-sign

- name: Build Linux System project (Ubuntu, local)
if: >
Expand All @@ -208,106 +209,129 @@ jobs:
briefcase build linux system
briefcase package linux system --adhoc-sign
- name: Build Linux System project (Debian, Dockerized)
- name: Build Linux System project (Ubuntu, aarch64)
if: >
startsWith(inputs.runner-os, 'ubuntu')
&& contains(fromJSON('["", "Linux"]'), inputs.target-platform)
&& contains(fromJSON('["", "system"]'), inputs.target-format)
run: |
cd tests/apps/verify-${{ inputs.framework }}
briefcase create linux system --target debian:bullseye
briefcase build linux system --target debian:bullseye
briefcase package linux system --target debian:bullseye --adhoc-sign
- name: Build Linux System project (RPM, Dockerized)
# fedora:37 ships with Python 3.11 and PySide2 cannot be installed
if: >
startsWith(inputs.runner-os, 'ubuntu')
&& !contains(fromJSON('["PySide2"]'), inputs.framework)
&& contains(fromJSON('["", "Linux"]'), inputs.target-platform)
&& contains(fromJSON('["", "system"]'), inputs.target-format)
run: |
cd tests/apps/verify-${{ inputs.framework }}
briefcase create linux system --target fedora:37
briefcase build linux system --target fedora:37
briefcase package linux system --target fedora:37 --adhoc-sign
- name: Build Linux System project (Arch, Dockerized)
# arch started shipping Python 3.11 on 3 may 2023 and PySide2 cannot be installed
if: >
startsWith(inputs.runner-os, 'ubuntu')
&& !contains(fromJSON('["PySide2"]'), inputs.framework)
&& contains(fromJSON('["", "Linux"]'), inputs.target-platform)
&& contains(fromJSON('["", "system"]'), inputs.target-format)
run: |
cd tests/apps/verify-${{ inputs.framework }}
briefcase create linux system --target archlinux:latest
briefcase build linux system --target archlinux:latest
briefcase package linux system --target archlinux:latest --adhoc-sign
- name: Build AppImage project
if: >
startsWith(inputs.runner-os, 'ubuntu')
&& contains(fromJSON('["", "Linux"]'), inputs.target-platform)
&& contains(fromJSON('["", "AppImage"]'), inputs.target-format)
run: |
cd tests/apps/verify-${{ inputs.framework }}
briefcase create linux AppImage
briefcase build linux AppImage
briefcase package linux AppImage --adhoc-sign
- name: Build Flatpak project
if: >
startsWith(inputs.runner-os, 'ubuntu')
&& contains(fromJSON('["", "Linux"]'), inputs.target-platform)
&& contains(fromJSON('["", "Flatpak"]'), inputs.target-format)
&& startsWith(inputs.framework, 'toga')
run: |
sudo apt-get update -y
sudo apt-get install -y flatpak flatpak-builder
cd tests/apps/verify-${{ inputs.framework }}
briefcase create linux flatpak
briefcase build linux flatpak
briefcase package linux flatpak --adhoc-sign
- name: Build Android App
if: >
contains(fromJSON('["", "Android"]'), inputs.target-platform)
&& contains(fromJSON('["", "Gradle"]'), inputs.target-format)
&& startsWith(inputs.framework, 'toga')
run: |
cd tests/apps/verify-${{ inputs.framework }}
briefcase create android gradle
briefcase build android gradle
briefcase package android gradle --adhoc-sign
- name: Build iOS App
if: >
startsWith(inputs.runner-os, 'macOS')
&& contains(fromJSON('["", "iOS"]'), inputs.target-platform)
&& contains(fromJSON('["", "Xcode"]'), inputs.target-format)
&& startsWith(inputs.framework, 'toga')
run: |
cd tests/apps/verify-${{ inputs.framework }}
briefcase create iOS xcode
briefcase build iOS xcode
briefcase package iOS xcode --adhoc-sign
- name: Build Web App
if: >
contains(fromJSON('["", "web"]'), inputs.target-platform)
&& contains(fromJSON('["", "static"]'), inputs.target-format)
&& startsWith(inputs.framework, 'toga')
run: |
cd tests/apps/verify-${{ inputs.framework }}
briefcase create web static
briefcase build web static
briefcase package web static
- name: Upload failure logs
uses: actions/upload-artifact@v3.1.2
if: failure()
uses: uraimo/run-on-arch-action@v2
with:
name: build-failure-logs-${{ inputs.framework }}-${{ inputs.python-version }}-${{ inputs.target-platform }}-${{ inputs.target-format }}
path: tests/apps/verify-${{ inputs.framework }}/logs/*
arch: "aarch64"
distro: "ubuntu22.04"
githubToken: ${{ github.token }}
dockerRunArgs: >
--workdir "/tests/apps/verify-${{ inputs.framework }}"
--volume "${PWD}/tests/apps/verify-${{ inputs.framework }}:/tests/apps/verify-${{ inputs.framework }}"
shell: /bin/bash
install: >
apt update &&
apt install -y python3-dev python3-pip libcairo2-dev libgirepository1.0-dev &&
python3 -m pip install git+${{ steps.briefcase.outputs.installed-repo }}@${{ steps.briefcase.outputs.installed-version }}
run: |
briefcase create linux system
briefcase build linux system
briefcase package linux system --adhoc-sign
# - name: Build Linux System project (Debian, Dockerized)
# if: >
# startsWith(inputs.runner-os, 'ubuntu')
# && contains(fromJSON('["", "Linux"]'), inputs.target-platform)
# && contains(fromJSON('["", "system"]'), inputs.target-format)
# run: |
# cd tests/apps/verify-${{ inputs.framework }}
# briefcase create linux system --target debian:bullseye
# briefcase build linux system --target debian:bullseye
# briefcase package linux system --target debian:bullseye --adhoc-sign
#
# - name: Build Linux System project (RPM, Dockerized)
# # fedora:37 ships with Python 3.11 and PySide2 cannot be installed
# if: >
# startsWith(inputs.runner-os, 'ubuntu')
# && !contains(fromJSON('["PySide2"]'), inputs.framework)
# && contains(fromJSON('["", "Linux"]'), inputs.target-platform)
# && contains(fromJSON('["", "system"]'), inputs.target-format)
# run: |
# cd tests/apps/verify-${{ inputs.framework }}
# briefcase create linux system --target fedora:37
# briefcase build linux system --target fedora:37
# briefcase package linux system --target fedora:37 --adhoc-sign
#
# - name: Build Linux System project (Arch, Dockerized)
# # arch started shipping Python 3.11 on 3 may 2023 and PySide2 cannot be installed
# if: >
# startsWith(inputs.runner-os, 'ubuntu')
# && !contains(fromJSON('["PySide2"]'), inputs.framework)
# && contains(fromJSON('["", "Linux"]'), inputs.target-platform)
# && contains(fromJSON('["", "system"]'), inputs.target-format)
# run: |
# cd tests/apps/verify-${{ inputs.framework }}
# briefcase create linux system --target archlinux:latest
# briefcase build linux system --target archlinux:latest
# briefcase package linux system --target archlinux:latest --adhoc-sign
#
# - name: Build AppImage project
# if: >
# startsWith(inputs.runner-os, 'ubuntu')
# && contains(fromJSON('["", "Linux"]'), inputs.target-platform)
# && contains(fromJSON('["", "AppImage"]'), inputs.target-format)
# run: |
# cd tests/apps/verify-${{ inputs.framework }}
# briefcase create linux AppImage
# briefcase build linux AppImage
# briefcase package linux AppImage --adhoc-sign
#
# - name: Build Flatpak project
# if: >
# startsWith(inputs.runner-os, 'ubuntu')
# && contains(fromJSON('["", "Linux"]'), inputs.target-platform)
# && contains(fromJSON('["", "Flatpak"]'), inputs.target-format)
# && startsWith(inputs.framework, 'toga')
# run: |
# sudo apt-get update -y
# sudo apt-get install -y flatpak flatpak-builder
#
# cd tests/apps/verify-${{ inputs.framework }}
# briefcase create linux flatpak
# briefcase build linux flatpak
# briefcase package linux flatpak --adhoc-sign
#
# - name: Build Android App
# if: >
# contains(fromJSON('["", "Android"]'), inputs.target-platform)
# && contains(fromJSON('["", "Gradle"]'), inputs.target-format)
# && startsWith(inputs.framework, 'toga')
# run: |
# cd tests/apps/verify-${{ inputs.framework }}
# briefcase create android gradle
# briefcase build android gradle
# briefcase package android gradle --adhoc-sign
#
# - name: Build iOS App
# if: >
# startsWith(inputs.runner-os, 'macOS')
# && contains(fromJSON('["", "iOS"]'), inputs.target-platform)
# && contains(fromJSON('["", "Xcode"]'), inputs.target-format)
# && startsWith(inputs.framework, 'toga')
# run: |
# cd tests/apps/verify-${{ inputs.framework }}
# briefcase create iOS xcode
# briefcase build iOS xcode
# briefcase package iOS xcode --adhoc-sign
#
# - name: Build Web App
# if: >
# contains(fromJSON('["", "web"]'), inputs.target-platform)
# && contains(fromJSON('["", "static"]'), inputs.target-format)
# && startsWith(inputs.framework, 'toga')
# run: |
# cd tests/apps/verify-${{ inputs.framework }}
# briefcase create web static
# briefcase build web static
# briefcase package web static
#
# - name: Upload failure logs
# uses: actions/upload-artifact@v3.1.2
# if: failure()
# with:
# name: build-failure-logs-${{ inputs.framework }}-${{ inputs.python-version }}-${{ inputs.target-platform }}-${{ inputs.target-format }}
# path: tests/apps/verify-${{ inputs.framework }}/logs/*
Loading

0 comments on commit 1fd2b46

Please sign in to comment.