mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-11-21 20:57:15 +00:00
ci: build unsigned apps in build-apps.yml
This commit is contained in:
1 parent
293fdb729d
commit
32dbaaa777
5 files changed
+700
-1
No files matched your search
@@ -0,0 +1,45 @@
|
||||
name: Setup Corretto
|
||||
description: >-
|
||||
The Amazon Corretto JDK that Dockerfile.build pins, from its archive checked against a pinned SHA-256: setup-java's
|
||||
corretto distribution installs only the latest release of a major version, so the JDK, and with it the app's runtime,
|
||||
launcher and dmg background, would change between builds of one commit.
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Download Corretto
|
||||
id: download
|
||||
shell: bash
|
||||
env:
|
||||
CORRETTO_VERSION: 17.0.21.0.10
|
||||
run: |
|
||||
case "$RUNNER_OS-$RUNNER_ARCH" in
|
||||
macOS-ARM64)
|
||||
file=amazon-corretto-$CORRETTO_VERSION-macosx-aarch64.tar.gz
|
||||
digest=85667cd211b7cef065a35d1ffbe16a19059493ac0130be5f0f93465458525d77 ;;
|
||||
macOS-X64)
|
||||
file=amazon-corretto-$CORRETTO_VERSION-macosx-x64.tar.gz
|
||||
digest=f13aa9654979894dddcd448f8b95b9b355c299c137cb47367cbb01b668b65f7b ;;
|
||||
Windows-X64)
|
||||
file=amazon-corretto-$CORRETTO_VERSION-windows-x64-jdk.zip
|
||||
digest=8681393133cde8d2fd0d52ccae48e8096b6eed11fc119eaf9cf1c84721311322 ;;
|
||||
*)
|
||||
echo "::error::no pinned Corretto for $RUNNER_OS $RUNNER_ARCH"
|
||||
exit 1 ;;
|
||||
esac
|
||||
archive="$RUNNER_TEMP/$file"
|
||||
curl --proto '=https' --tlsv1.2 -fsSL -o "$archive" "https://corretto.aws/downloads/resources/$CORRETTO_VERSION/$file"
|
||||
# from stdin, as sha256sum prefixes the digest of a path with backslashes with "\"
|
||||
actual=$( { sha256sum 2>/dev/null || shasum -a 256; } < "$archive" | cut -d' ' -f1)
|
||||
if [ "$actual" != "$digest" ]; then
|
||||
echo "::error::$file has SHA-256 $actual, not the pinned $digest"
|
||||
exit 1
|
||||
fi
|
||||
echo "archive=$archive" >> "$GITHUB_OUTPUT"
|
||||
echo "version=${CORRETTO_VERSION%.*.*}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Install Corretto
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: jdkfile
|
||||
jdkFile: ${{ steps.download.outputs.archive }}
|
||||
java-version: ${{ steps.download.outputs.version }}
|
||||
@@ -0,0 +1,27 @@
|
||||
name: Use the release Xcode
|
||||
description: >-
|
||||
Selects Xcode 26.6, XCODE in scripts/simplex_build/apple.py, at /Applications/Xcode.app, where the iOS build needs it
|
||||
because the dSYMs name its path; the runner images link that path to their default Xcode, and keep each Xcode at
|
||||
/Applications/Xcode_<version>.app, which stays a link to it.
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Move Xcode to /Applications/Xcode.app
|
||||
shell: bash
|
||||
env:
|
||||
RELEASE_XCODE: /Applications/Xcode_26.6.app
|
||||
USUAL_XCODE: /Applications/Xcode.app
|
||||
run: |
|
||||
if [ ! -L "$RELEASE_XCODE" ]; then
|
||||
if [ -L "$USUAL_XCODE" ]; then
|
||||
sudo rm "$USUAL_XCODE"
|
||||
fi
|
||||
if [ -e "$USUAL_XCODE" ]; then
|
||||
echo "::error::$USUAL_XCODE is not a link to the image's default Xcode"
|
||||
exit 1
|
||||
fi
|
||||
sudo mv "$RELEASE_XCODE" "$USUAL_XCODE"
|
||||
sudo ln -s "$USUAL_XCODE" "$RELEASE_XCODE"
|
||||
fi
|
||||
echo "DEVELOPER_DIR=$USUAL_XCODE/Contents/Developer" >> "$GITHUB_ENV"
|
||||
DEVELOPER_DIR=$USUAL_XCODE/Contents/Developer xcodebuild -version
|
||||
@@ -0,0 +1,551 @@
|
||||
name: build-apps
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: build-apps-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
HOMEBREW_NO_AUTO_UPDATE: 1
|
||||
HOMEBREW_NO_INSTALL_CLEANUP: 1
|
||||
# newer images add Command Line Tools whose macOS SDK the default Xcode's linker cannot read
|
||||
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer
|
||||
|
||||
jobs:
|
||||
# every build must open this encrypted database, made by the previous release with its own OpenSSL
|
||||
old-database:
|
||||
name: Previous release's database
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Make the database
|
||||
run: python3 scripts/simplex-chat-build.py test old-database --out "$RUNNER_TEMP/old-database"
|
||||
|
||||
- name: Upload the database
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: old-database
|
||||
path: ${{ runner.temp }}/old-database
|
||||
retention-days: 30
|
||||
if-no-files-found: error
|
||||
|
||||
android:
|
||||
name: Android ${{ matrix.arch }} APK
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 360
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
arch: [aarch64, armv7a]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
filter: tree:0
|
||||
|
||||
- name: Show runner
|
||||
run: |
|
||||
lsb_release -ds
|
||||
nproc
|
||||
free -h
|
||||
df -h /
|
||||
|
||||
- name: Free disk space
|
||||
run: scripts/ci/linux_util_free_space.sh
|
||||
|
||||
- name: Setup swap
|
||||
if: matrix.arch == 'armv7a'
|
||||
uses: ./.github/actions/swap
|
||||
with:
|
||||
swap-size-gb: 30
|
||||
|
||||
# the Nix sandbox needs user namespaces, which Ubuntu 24.04 restricts
|
||||
- name: Allow user namespaces
|
||||
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
|
||||
|
||||
- name: Build APK
|
||||
run: scripts/simplex-chat-build.py build apk ${{ matrix.arch }} --out "$RUNNER_TEMP/out" --nix-cache
|
||||
|
||||
- name: Upload APK
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: android-${{ matrix.arch }}-unsigned
|
||||
path: ${{ runner.temp }}/out
|
||||
compression-level: 0
|
||||
retention-days: 30
|
||||
if-no-files-found: error
|
||||
|
||||
android-bundle:
|
||||
name: Android Play bundle
|
||||
needs: android
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 120
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Free disk space
|
||||
run: scripts/ci/linux_util_free_space.sh
|
||||
|
||||
- name: Download core libraries
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
pattern: android-*-unsigned
|
||||
path: ${{ runner.temp }}/libs
|
||||
|
||||
- name: Build bundle
|
||||
run: scripts/simplex-chat-build.py build aab --libs "$RUNNER_TEMP/libs" --out "$RUNNER_TEMP/out"
|
||||
|
||||
- name: Upload bundle
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: android-bundle-unsigned
|
||||
path: ${{ runner.temp }}/out
|
||||
compression-level: 0
|
||||
retention-days: 30
|
||||
if-no-files-found: error
|
||||
|
||||
android-test:
|
||||
name: Android ${{ matrix.arch }} APK in the emulator
|
||||
needs: [android, old-database, desktop-linux]
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- arch: aarch64
|
||||
api: 34
|
||||
- arch: armv7a
|
||||
api: 30
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Download APK
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: android-${{ matrix.arch }}-unsigned
|
||||
path: ${{ runner.temp }}/apks
|
||||
|
||||
# the emulator's qemu needs libpulse0 and libegl1
|
||||
- name: Install emulator and system image
|
||||
run: |
|
||||
sudo apt-get install -y libpulse0 libegl1
|
||||
scripts/ci/android/install-sdk.sh "$RUNNER_TEMP/android-sdk" ${{ matrix.api }}
|
||||
|
||||
- name: Boot emulator
|
||||
run: scripts/ci/android/emulator.sh start "$RUNNER_TEMP/screens"
|
||||
|
||||
# the unsigned APKs are signed with a throwaway key, which Android needs to install them
|
||||
- name: Download the previous release's database
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: old-database
|
||||
path: ${{ runner.temp }}/old-database
|
||||
|
||||
- name: Smoke test
|
||||
run: |
|
||||
python3 scripts/simplex-chat-build.py test apk "$RUNNER_TEMP/apks/simplex-${{ matrix.arch }}.apk" \
|
||||
--out "$RUNNER_TEMP/screens" --database "$RUNNER_TEMP/old-database"
|
||||
|
||||
# the new CLI is the app's peer on the preset servers
|
||||
- name: Download the CLI
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: desktop-ubuntu-24.04-x86_64
|
||||
path: ${{ runner.temp }}/cli
|
||||
|
||||
- name: Upgrade and quantum resistant contact
|
||||
run: |
|
||||
python3 scripts/simplex-chat-build.py test apk "$RUNNER_TEMP/apks/simplex-${{ matrix.arch }}.apk" \
|
||||
--out "$RUNNER_TEMP/screens" --upgrade-from-previous --cli "$RUNNER_TEMP/cli/simplex-chat-ubuntu-24_04-x86_64"
|
||||
|
||||
- name: Upload screenshots
|
||||
if: ${{ !cancelled() }}
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: screens-android-${{ matrix.arch }}
|
||||
path: ${{ runner.temp }}/screens
|
||||
retention-days: 30
|
||||
if-no-files-found: ignore
|
||||
|
||||
ios:
|
||||
name: iOS archive
|
||||
runs-on: macos-26
|
||||
timeout-minutes: 360
|
||||
env:
|
||||
HAS_ART_KEY: ${{ secrets.SIMPLEX_ART_SSH_KEY != '' }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
filter: tree:0
|
||||
|
||||
- name: Use the release Xcode
|
||||
uses: ./.github/actions/xcode
|
||||
|
||||
- name: Show runner
|
||||
run: |
|
||||
sw_vers
|
||||
df -h /
|
||||
xcodebuild -version
|
||||
|
||||
- name: Use the macOS 26 SDK
|
||||
run: scripts/ci/ios-sim/use-macos26-sdk.sh
|
||||
|
||||
# the brand assets of release builds are in this private repository; without its key, as on forks, the archive
|
||||
# has the default icons
|
||||
- name: Checkout brand assets
|
||||
if: env.HAS_ART_KEY == 'true'
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: simplex-chat/simplex-chat-art
|
||||
ssh-key: ${{ secrets.SIMPLEX_ART_SSH_KEY }}
|
||||
path: simplex-chat-art
|
||||
|
||||
- name: Build archive
|
||||
run: scripts/simplex-chat-build.py build xcarchive ${{ env.HAS_ART_KEY == 'true' && '--art simplex-chat-art' || '' }} --out "$RUNNER_TEMP/out" --install-nix
|
||||
|
||||
- name: Upload archive
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: ios-archive-unsigned
|
||||
path: ${{ runner.temp }}/out
|
||||
compression-level: 0
|
||||
retention-days: 30
|
||||
if-no-files-found: error
|
||||
|
||||
# the archive's core, from Nix, relabelled for the simulator: the same objects as the archive's, in the simulator app
|
||||
ios-test:
|
||||
name: iOS app in the simulator
|
||||
needs: [ios, old-database, desktop-macos]
|
||||
runs-on: macos-26
|
||||
timeout-minutes: 120
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Use the release Xcode
|
||||
uses: ./.github/actions/xcode
|
||||
|
||||
- name: Use the macOS 26 SDK
|
||||
run: scripts/ci/ios-sim/use-macos26-sdk.sh
|
||||
|
||||
- name: Download the archive's core
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: ios-archive-unsigned
|
||||
path: ${{ runner.temp }}/ios
|
||||
|
||||
- name: Prepare libraries
|
||||
run: scripts/simplex-chat-build.py install libs ios "$RUNNER_TEMP"/ios/pkg-ios-*.zip
|
||||
|
||||
- name: Build app
|
||||
run: |
|
||||
xcodebuild build -quiet \
|
||||
-project apps/ios/SimpleX.xcodeproj \
|
||||
-scheme "SimpleX (iOS)" \
|
||||
-configuration Debug \
|
||||
-destination 'generic/platform=iOS Simulator' \
|
||||
-derivedDataPath "$RUNNER_TEMP/DerivedData" \
|
||||
-onlyUsePackageVersionsFromResolvedFile \
|
||||
-skipPackagePluginValidation \
|
||||
-skipMacroValidation \
|
||||
ARCHS=arm64 \
|
||||
CODE_SIGN_STYLE=Manual \
|
||||
CODE_SIGN_IDENTITY=- \
|
||||
DEVELOPMENT_TEAM= \
|
||||
PROVISIONING_PROFILE_SPECIFIER=
|
||||
|
||||
- name: Install AXe
|
||||
run: scripts/ci/ios-sim/install-axe.sh
|
||||
|
||||
- name: Smoke test
|
||||
run: scripts/ci/ios-sim/smoke-test.sh "$RUNNER_TEMP/DerivedData/Build/Products/Debug-iphonesimulator/SimpleX.app" "$RUNNER_TEMP/screens"
|
||||
|
||||
# the new CLI is the app's peer on the preset servers
|
||||
- name: Download the CLI
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: desktop-macos-aarch64-unsigned
|
||||
path: ${{ runner.temp }}/cli
|
||||
|
||||
- name: Quantum resistant contact
|
||||
run: scripts/ci/ios-sim/pq-contact.sh "$RUNNER_TEMP/cli/simplex-chat-macos-aarch64" "$RUNNER_TEMP/peer"
|
||||
|
||||
- name: Download the previous release's database
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: old-database
|
||||
path: ${{ runner.temp }}/old-database
|
||||
|
||||
- name: Open the previous release's database
|
||||
run: scripts/ci/ios-sim/old-database.sh "$RUNNER_TEMP/old-database"
|
||||
|
||||
- name: Upload screenshots
|
||||
if: ${{ !cancelled() }}
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: screens-ios
|
||||
path: ${{ runner.temp }}/screens
|
||||
retention-days: 30
|
||||
if-no-files-found: ignore
|
||||
|
||||
desktop-linux:
|
||||
name: Desktop Ubuntu ${{ matrix.ubuntu }} ${{ matrix.arch }}
|
||||
needs: old-database
|
||||
runs-on: ${{ matrix.runner }}
|
||||
timeout-minutes: 240
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- { ubuntu: "22.04", arch: x86_64, runner: ubuntu-22.04 }
|
||||
- { ubuntu: "24.04", arch: x86_64, runner: ubuntu-24.04 }
|
||||
- { ubuntu: "22.04", arch: aarch64, runner: ubuntu-22.04-arm }
|
||||
- { ubuntu: "24.04", arch: aarch64, runner: ubuntu-24.04-arm }
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Free disk space
|
||||
run: scripts/ci/linux_util_free_space.sh
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v7
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Build CLI and desktop apps
|
||||
run: |
|
||||
version=$(sed -n 's/^version: *//p' simplex-chat.cabal)
|
||||
python3 scripts/simplex-chat-build.py build desktop linux ${{ matrix.ubuntu }} --version "$version" --out "$RUNNER_TEMP/out"
|
||||
|
||||
- name: Upload apps
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: desktop-ubuntu-${{ matrix.ubuntu }}-${{ matrix.arch }}
|
||||
path: ${{ runner.temp }}/out
|
||||
compression-level: 0
|
||||
retention-days: 30
|
||||
if-no-files-found: error
|
||||
|
||||
# the desktop deb's post-install script runs xdg-desktop-menu, which fails without this directory
|
||||
- name: Install a display for the smoke tests
|
||||
run: |
|
||||
sudo apt-get install -y --no-install-recommends xvfb openbox xdotool imagemagick
|
||||
sudo mkdir -p /usr/share/desktop-directories
|
||||
|
||||
# each file runs as its users run it, and the apps leave screenshots
|
||||
- name: Download the previous release's database
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: old-database
|
||||
path: ${{ runner.temp }}/old-database
|
||||
|
||||
# each upgrade test installs the previous release's app where no app is installed, and uninstalls the app after
|
||||
- name: Smoke test
|
||||
run: |
|
||||
out=$RUNNER_TEMP/out
|
||||
ubuntu=${{ matrix.ubuntu }}
|
||||
name=ubuntu-${ubuntu//./_}-${{ matrix.arch }}
|
||||
old=(--database "$RUNNER_TEMP/old-database")
|
||||
upgrade=(--upgrade-from-previous --cli "$out/simplex-chat-$name")
|
||||
python3 scripts/simplex-chat-build.py test cli "$out/simplex-chat-$name" --out "$RUNNER_TEMP/screens" "${old[@]}"
|
||||
python3 scripts/simplex-chat-build.py test desktop "$out/simplex-desktop-$name.deb" --out "$RUNNER_TEMP/screens" "${upgrade[@]}"
|
||||
python3 scripts/simplex-chat-build.py test desktop "$out/simplex-desktop-$name.deb" --out "$RUNNER_TEMP/screens" \
|
||||
"${old[@]}" --cli "$out/simplex-chat-$name"
|
||||
if [ -f "$out/simplex-desktop-${{ matrix.arch }}.AppImage" ]; then
|
||||
python3 scripts/simplex-chat-build.py test desktop "$out/simplex-desktop-${{ matrix.arch }}.AppImage" --out "$RUNNER_TEMP/screens" \
|
||||
"${upgrade[@]}"
|
||||
python3 scripts/simplex-chat-build.py test desktop "$out/simplex-desktop-${{ matrix.arch }}.AppImage" --out "$RUNNER_TEMP/screens" \
|
||||
"${old[@]}" --cli "$out/simplex-chat-$name"
|
||||
fi
|
||||
|
||||
- name: Upload screenshots
|
||||
if: ${{ !cancelled() }}
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: screens-ubuntu-${{ matrix.ubuntu }}-${{ matrix.arch }}
|
||||
path: ${{ runner.temp }}/screens
|
||||
retention-days: 30
|
||||
if-no-files-found: ignore
|
||||
|
||||
desktop-macos:
|
||||
name: Desktop macOS ${{ matrix.arch }}
|
||||
needs: old-database
|
||||
runs-on: ${{ matrix.runner }}
|
||||
timeout-minutes: 240
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- { arch: aarch64, runner: macos-26 }
|
||||
- { arch: x86_64, runner: macos-26-intel }
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Use the release Xcode
|
||||
uses: ./.github/actions/xcode
|
||||
|
||||
# GHC's C compiler uses the Command Line Tools' SDK
|
||||
- name: Point Command Line Tools SDK to Xcode SDK
|
||||
run: sudo ln -sfn "$(xcrun --sdk macosx --show-sdk-path)" /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
|
||||
|
||||
- name: Setup Haskell
|
||||
uses: simplex-chat/setup-haskell-action@v2
|
||||
with:
|
||||
ghc-version: 9.6.3
|
||||
cabal-version: 3.10.2.0
|
||||
|
||||
- name: Setup Java
|
||||
uses: ./.github/actions/setup-corretto
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v7
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Build CLI, desktop app and libraries
|
||||
run: python3 scripts/simplex-chat-build.py build desktop macos --out "$RUNNER_TEMP/out"
|
||||
|
||||
- name: Upload apps
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: desktop-macos-${{ matrix.arch }}-unsigned
|
||||
path: ${{ runner.temp }}/out
|
||||
compression-level: 0
|
||||
retention-days: 30
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Download the previous release's database
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: old-database
|
||||
path: ${{ runner.temp }}/old-database
|
||||
|
||||
- name: Smoke test
|
||||
run: |
|
||||
out=$RUNNER_TEMP/out
|
||||
cli=simplex-chat-macos-${{ matrix.arch == 'aarch64' && 'aarch64' || 'x86-64' }}
|
||||
old=(--database "$RUNNER_TEMP/old-database")
|
||||
python3 scripts/simplex-chat-build.py test cli "$out/$cli" --out "$RUNNER_TEMP/screens" "${old[@]}"
|
||||
python3 scripts/simplex-chat-build.py test desktop "$out/simplex-desktop-macos-${{ matrix.arch }}.dmg" --out "$RUNNER_TEMP/screens" \
|
||||
--upgrade-from-previous --cli "$out/$cli"
|
||||
python3 scripts/simplex-chat-build.py test desktop "$out/simplex-desktop-macos-${{ matrix.arch }}.dmg" --out "$RUNNER_TEMP/screens" \
|
||||
"${old[@]}" --cli "$out/$cli"
|
||||
|
||||
- name: Upload screenshots
|
||||
if: ${{ !cancelled() }}
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: screens-macos-${{ matrix.arch }}
|
||||
path: ${{ runner.temp }}/screens
|
||||
retention-days: 30
|
||||
if-no-files-found: ignore
|
||||
|
||||
desktop-windows:
|
||||
name: Desktop Windows
|
||||
needs: old-database
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 240
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
steps:
|
||||
# Git for Windows checks files out with CRLF line endings, which the Windows build would compile into the binaries
|
||||
- name: Check out with the repository's line endings
|
||||
shell: bash
|
||||
run: git config --global core.autocrlf false
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Configure pagefile
|
||||
uses: simplex-chat/configure-pagefile-action@v1.4
|
||||
with:
|
||||
minimum-size: 16GB
|
||||
maximum-size: 16GB
|
||||
# C: holds the fixed directory of the Windows builds, and has about 30 GB free
|
||||
disk-root: "D:"
|
||||
|
||||
- name: Setup Haskell
|
||||
uses: simplex-chat/setup-haskell-action@v2
|
||||
with:
|
||||
ghc-version: 9.6.3
|
||||
cabal-version: 3.10.2.0
|
||||
|
||||
- name: Setup Java
|
||||
uses: ./.github/actions/setup-corretto
|
||||
|
||||
- name: Setup MSYS2
|
||||
uses: simplex-chat/setup-msys2@v2
|
||||
with:
|
||||
msystem: ucrt64
|
||||
update: true
|
||||
install: >-
|
||||
git
|
||||
perl
|
||||
make
|
||||
pacboy: >-
|
||||
toolchain:p
|
||||
cmake:p
|
||||
python:p
|
||||
|
||||
- name: Build CLI, desktop app and libraries
|
||||
run: |
|
||||
export PATH=$PATH:/c/ghcup/bin:$(echo /c/tools/ghc-*/bin || echo)
|
||||
python scripts/simplex-chat-build.py build desktop windows --out "$(cygpath -w "$RUNNER_TEMP")/out"
|
||||
|
||||
- name: Upload apps
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: desktop-windows-unsigned
|
||||
path: ${{ runner.temp }}/out
|
||||
compression-level: 0
|
||||
retention-days: 30
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Download the previous release's database
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: old-database
|
||||
path: ${{ runner.temp }}/old-database
|
||||
|
||||
- name: Smoke test
|
||||
run: |
|
||||
out="$(cygpath -w "$RUNNER_TEMP")/out"
|
||||
screens="$(cygpath -w "$RUNNER_TEMP")/screens"
|
||||
old="$(cygpath -w "$RUNNER_TEMP")/old-database"
|
||||
python scripts/simplex-chat-build.py test cli "$out/simplex-chat-windows-x86-64" --out "$screens" --database "$old"
|
||||
python scripts/simplex-chat-build.py test desktop "$out/simplex-desktop-windows-x86_64.msi" --out "$screens" \
|
||||
--upgrade-from-previous --cli "$out/simplex-chat-windows-x86-64"
|
||||
python scripts/simplex-chat-build.py test desktop "$out/simplex-desktop-windows-x86_64.msi" --out "$screens" \
|
||||
--database "$old" --cli "$out/simplex-chat-windows-x86-64"
|
||||
|
||||
- name: Upload screenshots
|
||||
if: ${{ !cancelled() }}
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: screens-windows
|
||||
path: ${{ runner.temp }}/screens
|
||||
retention-days: 30
|
||||
if-no-files-found: ignore
|
||||
@@ -35,7 +35,7 @@ Results:
|
||||
|
||||
### Scopes
|
||||
|
||||
The reduced build runs one Linux job, build-linux (ubuntu-22.04 x86_64), for every scope except ios, and one macOS job, build-ios (macos-latest), for ios.
|
||||
The reduced build runs one Linux job, build-linux (ubuntu-22.04 x86_64), for every scope except ios, and one macOS job, build-ios (macos-26), for ios.
|
||||
|
||||
#### core
|
||||
|
||||
@@ -182,3 +182,7 @@ Each run uploads the app it built, for manual tests, as an artifact kept 14 days
|
||||
## The Claude job
|
||||
|
||||
It needs the GitHub environment `app-sim-claude` with the secret `CLAUDE_CODE_OAUTH_TOKEN`, a Claude subscription token. The environment's branch rule alone decides which branches may use it: on a branch it doesn't allow, a run that asks for Claude fails at the Claude job's environment check, and the scripted test runs as usual. Each run spends the subscription's usage limits; the job summary gives its tokens and cost estimated at API prices.
|
||||
|
||||
## Builds for signing
|
||||
|
||||
`build-apps.yml`, also started only by hand, builds the Android APKs, the Play bundle and the iOS archive of a commit without signing them, and uploads them as artifacts for signing outside CI: [details](build-apps/README.md).
|
||||
@@ -0,0 +1,72 @@
|
||||
# App builds for signing
|
||||
|
||||
`.github/workflows/build-apps.yml` builds the Android and iOS apps of a commit without signing them and uploads them as artifacts, to be signed outside CI. No signing key or certificate reaches GitHub.
|
||||
|
||||
Each job runs `scripts/simplex-chat-build.py build` (its code is the `scripts/simplex_build` package, tested with `python3 -m unittest discover -s scripts/simplex_build -t scripts`), the script that also reproduces releases ([docs/REPRODUCE.md](../../../docs/REPRODUCE.md)), so a reproduce run rebuilds an APK exactly as this workflow built it. The same commands build locally: `build apk <arch> --out <dir>`, `build aab --libs <dir> --out <dir>` with Docker, and `build xcarchive --art <simplex-chat-art> --out <dir>` on a Mac with Xcode and Nix.
|
||||
|
||||
## Smoke tests
|
||||
|
||||
After each build the job runs what it built as users do, with `scripts/simplex-chat-build.py test`: each CLI prints its version; the Linux debs and AppImage, the macOS dmg and the Windows msi are installed and started, and pass when the app keeps running and its screenshot shows a window (on Linux the test also waits for the window); the APKs, signed with a throwaway key, start in an Android emulator, aarch64 on Android 14 and armv7a on Android 11, the last x86_64 image that runs 32-bit ARM code. The iOS archive's Nix core, relabelled for the simulator, runs in the iOS simulator app (job ios-test). Each app leaves a screenshot, in the artifacts `screens-<platform>`.
|
||||
|
||||
The job old-database makes an encrypted database with the previous release's CLI (v7.0.3, pinned by SHA-256), and every build must open it with its key: each CLI opens and migrates it and refuses a wrong key; each desktop app opens and migrates it, which the new CLI then checks; the Android apps open it from the passphrase screen, and the iOS app in the simulator too. Each desktop package is also installed over the v7.0.3 package that the old app started first, and the new app must open the database the old app made (`test desktop --upgrade-from-previous`).
|
||||
|
||||
Two tests cover the OpenSSL of the mobile apps' core beyond opening a database:
|
||||
|
||||
- **Upgrade** (`test apk --upgrade-from-previous`): the v7.0.3 APK for the same ABI, pinned by its SHA-256 and signed with the same throwaway key as the new APK, installs, makes a profile through onboarding and keeps its database key in the Android keystore; the new APK installs over it (`adb install -r`) and must show the chat list, not the passphrase or database error screen. Screenshots `<apk>.v7.0.3.png` and `<apk>.upgraded.png`.
|
||||
- **Quantum resistant contact** (`test apk --cli`, `scripts/ci/ios-sim/pq-contact.sh`): the upgraded Android app, and the iOS simulator app with the archive's core, take a one-time link of the new CLI from the desktop jobs, both on the preset servers (Android through a VIEW intent, iOS pasted, as `simctl openurl` delivered a link the core rejected), and exchange a message each way. The CLI's `/i` must show "quantum resistant end-to-end encryption"; the Android chat must show "quantum resistant e2e encryption", and the iOS contact info "E2E encryption: Quantum resistant", since the iOS accessibility tree has no message texts. sntrup761, the KEM of these connections, hashes with OpenSSL's SHA-512. Screenshots `<apk>.upgraded.pq.png`, `pq-messages` and `pq-contact-info`, with the peer's log and contact info.
|
||||
|
||||
## Running it
|
||||
|
||||
The workflow runs only when started by hand, on any branch: in the Actions tab, `build-apps` → Run workflow, or `gh workflow run build-apps.yml --ref <branch>`. A newer run on the same branch cancels the older one. Start it on master or a branch of master: armv7a is built from the same commit, which `stable` only supports once it carries the armv7a build of master.
|
||||
|
||||
It needs the repository secret `SIMPLEX_ART_SSH_KEY`, the private half of a read-only deploy key of simplex-chat/simplex-chat-art, for the iOS brand assets; without it, as on forks, the archive has the default icons and the build warns.
|
||||
|
||||
## Jobs and artifacts
|
||||
|
||||
| Job | Runner | Builds | Artifact, kept 30 days |
|
||||
|---|---|---|---|
|
||||
| Android aarch64 APK, Android armv7a APK | ubuntu-24.04 | `build apk <arch>`: `scripts/android/build-android.sh` in the `Dockerfile.build` container | `android-<arch>-unsigned`: `simplex-<arch>.apk`, `pkg-<arch>-android-libsimplex.zip`, `pkg-<arch>-android-libsupport.zip`, `SHA256SUMS` |
|
||||
| Android Play bundle | ubuntu-24.04 | `build aab`: `:android:bundleGoogleRelease` in the same container, with both arches' core libraries from the APK jobs and release-mobile.py's `local.properties` | `android-bundle-unsigned`: `simplex.aab`, `SHA256SUMS` |
|
||||
| iOS archive | macos-26 | `build xcarchive` with Xcode 26.6: the core library `aarch64-darwin-ios:lib:simplex-chat` with Nix, the brand assets of simplex-chat-art, then `xcodebuild archive` of the Release configuration for devices, unsigned, and each bundle signed ad hoc with its entitlements | `ios-archive-unsigned`: `SimpleX.xcarchive.zip`, `SHA256SUMS` |
|
||||
|
||||
`gh run download <run id> -n <artifact>` downloads one. The version and build numbers are the commit's: bump them before the run.
|
||||
|
||||
## Android: signing reproducibly
|
||||
|
||||
The APKs are the foss flavor, as `scripts/android/build-android.sh` builds them: AGP's unsigned output, which is deterministic. Two runs on different runners built byte-identical APKs, core libraries and bundles.
|
||||
|
||||
Releases are signed by Gradle, with the release signing config that `apps/multiplatform/android/build.gradle.kts` reads from `ANDROID_KEYSTORE`, `ANDROID_KEYSTORE_PASSWORD`, `ANDROID_KEY_ALIAS` and `ANDROID_KEY_PASSWORD`, or with the `android.injected.signing.*` properties that release-mobile.py passes. With the variables set, `build android-apk` and `build aab` mount the keystore read-only and pass the passwords to Docker by name, so that they are in no command line; without them the script and Gradle warn that the build is unsigned. CI never has the key. An APK of this artifact signed outside Gradle stays verifiable when its layout is kept: `apksigner sign --alignment-preserved`.
|
||||
|
||||
The reproduce script rebuilds the APK, copies the release's signature onto it with `apksigcopier` and compares the two. Releases signed before Gradle signed them, by apksigner after a repack, are checked by aligning the rebuilt APK to 16 KB pages with `repro-apk zipalign` first, padded as the released APK is (apksigner 35 and later pad with their `0xd935` extra field, older ones with zeros), and restoring the ZIP flags of the v1 signature files that apksigcopier 1.1.1 drops.
|
||||
|
||||
The bundle is the google flavor for Google Play; nothing checks its reproducibility.
|
||||
|
||||
## iOS: signing at export
|
||||
|
||||
The export of an archive keeps only the entitlements that each bundle's signature carries: an unsigned archive exports without app groups, keychain groups or push. Xcode refuses ad-hoc signing for iOS devices ("Ad Hoc code signing is not allowed with SDK"), so the script archives with `CODE_SIGNING_ALLOWED=NO`, then signs the extensions and the app ad hoc with `codesign`, each with its `.entitlements` file and `$(AppIdentifierPrefix)` replaced by the team id, and fails unless each signature carries exactly those entitlements. It records the team in the archive's Info.plist, as Xcode does when it signs.
|
||||
|
||||
Compared with the 7.1-beta.7 release archive, which Xcode signed with an Apple Development identity, the bundles have the same files except the development profiles (`embedded.mobileprovision`), and the same entitlements except `application-identifier`, `com.apple.developer.team-identifier` and `get-task-allow`, which the export takes from the distribution profile.
|
||||
|
||||
To sign for the App Store: on a Mac with the distribution certificate, unzip the archive, open `SimpleX.xcarchive` in Xcode's Organizer and use Distribute App, or run `xcodebuild -exportArchive`.
|
||||
|
||||
It also fails when an object of the core library is marked for a newer iOS than the app's deployment target: mac2ios relabels the library's macOS objects as iOS and keeps their minimum version.
|
||||
|
||||
## macOS and iOS: reproducibility
|
||||
|
||||
The unsigned macOS files (the dmg, the CLI and the libraries zip of `build desktop macos` and `build libs macos`) and the iOS archive and core package of `build xcarchive` don't depend on the Mac that builds them, its paths or its user; signed macOS releases, whose Developer ID signatures and notarization tickets differ on each signing, are compared with such a build after their signatures are removed. The builds remove what the machine would add:
|
||||
|
||||
- **Xcode**: they fail unless the selected Xcode is 26.6 (17F113), `XCODE` in `scripts/simplex_build/apple.py`, whose compilers, linker and SDKs write the binaries. Of GitHub's images only macos-26 and macos-26-intel have it, so every macOS job runs on one of them and selects it with the action `.github/actions/xcode`, which moves it to `/Applications/Xcode.app`: the iOS build needs it there, as the dSYMs name Xcode's paths in the Swift modules they embed and in the API notes of Clang's modules, which `-debug-prefix-map` doesn't change. The macOS builds compile and link with its macOS SDK (`SDKROOT`), and fail unless `/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk`, which GHC's libraries list as a library directory, is missing or links to it: the jobs link it.
|
||||
- **Minimum macOS**: without `MACOSX_DEPLOYMENT_TARGET` the CLI and libraries required the macOS of the machine that built them, 26.0 on aarch64 and 15.0 on x86_64 in the releases until v7.1.0-beta.8. The builds set it to 11.0 (`MACOS_DEPLOYMENT_TARGET` in `scripts/simplex_build/macos.py`), the minimum of the bundled launcher and JDK runtime, the newest of the parts not built here (VLC's, skiko's and GHC's libraries need 10.8 to 11.0), and fail when the CLI, a library or the app's JNI library needs a newer macOS, or when the app's Info.plist declares another minimum (`LSMinimumSystemVersion`, which `minimumSystemVersion` in `apps/multiplatform/desktop/build.gradle.kts` sets; it was Compose's default, 10.13).
|
||||
- **Paths**: they copy the checkout to `/private/tmp/simplex-chat-build/simplex-chat`, with the modes of a checkout made with umask 022, and build there, with cabal's directory (`CABAL_DIR`), the temporary directory (`TMPDIR`), DerivedData and the other build files in `/private/tmp/simplex-chat-build`, which they remove before and after. The binaries contain the paths of the checkout, of OpenSSL's prefix and of cabal's package store; the dSYMs those of the checkout, DerivedData and Swift's macro expansions in `TMPDIR`. `build libs macos` copies the libraries back into the checkout for its Gradle build.
|
||||
- **Settings**: umask 022, `LC_ALL=en_US.UTF-8` and `TZ=UTC`, as on GitHub's runners. The iOS bundles' `BuildMachineOSBuild`, the build of the macOS that Xcode runs on, is pinned to 25G83.
|
||||
- **Libraries**: Cabal and GHC link each library with an absolute rpath to the directory of each library it depends on, GHC's own and the SDK's in Xcode among them, and their room in the load commands moved the libraries' code with where GHC and Xcode are. The packages link with `-fno-use-rpaths` and `-pgml` of `scripts/simplex_build/link_without_rpaths.py`, which drops absolute rpaths from the linker's arguments and GHC's response files; the build finds the libraries it bundles in cabal's store and GHC's directory, and fails when one of them, or the app's JNI library, has an rpath not relative to it (`@loader_path`, `@executable_path`): dyld searches an absolute rpath, which another user may create, such as one in `/private/tmp`, before `@loader_path`, and the app's entitlements disable library validation. The JNI library's CMake build links it with `@loader_path` only.
|
||||
- **dmg**: libdmg-hfsplus is linked with zlib 1.3.1, built from its pinned source, rather than the SDK's zlib that CMake finds, and the dmg's UDIF segment id, which libdmg took from the unseeded `rand()`, is pinned to the value of the dmgs built before.
|
||||
- **Swift**: the Swift compiler orders some of its output by memory addresses: with ASLR, SwiftyGif's `calculateFrameDelay` compiled differently in 1.5 to 10% of compilations. `build xcarchive` starts `xcodebuild` with `_POSIX_SPAWN_DISABLE_ASLR`, which the compilers it starts inherit, and fails unless two programs started that way load at the same address.
|
||||
- **Check**: each build fails, after writing its files, when they contain a path of the machine: the original checkout, the home directory, the user's temporary and cache directories, or Xcode's when it is not in `/Applications/Xcode.app`. VLC's prebuilt libraries, which contain the paths of the runner that built them, are not checked.
|
||||
|
||||
Run [41369223439](https://github.com/sh-agents/simplex-chat/actions/runs/41369223439) built the desktop files twice on each architecture (macos-26 for aarch64, macos-26-intel for x86_64), and run [41331759753](https://github.com/sh-agents/simplex-chat/actions/runs/41331759753) the iOS archive twice: build b ran from another checkout path, with another home, temporary directory, user name, locale, time zone, umask (077) and, for the desktop, Xcode path, and gave byte-identical files. Only macos-26 images have Xcode 26.6, so both builds ran on the same macOS; the Nix iOS core package was also the same on macos-15 and macos-26. With ASLR off the SwiftyGif sources compiled identically 1379 times, against 19 differences in 1261 compilations with ASLR (run [41326351453](https://github.com/sh-agents/simplex-chat/actions/runs/41326351453)).
|
||||
|
||||
## Known limits
|
||||
|
||||
- **The core libraries rely on cache.zw3rk.com** for the cross-compiling toolchains and dependencies, as android-emu does: without it they take 12 to 24 hours, longer than a job may run. On a recent master commit only simplexmq and simplex-chat are built. armv7a uses GHC 8.10.7, whose Template Haskell runs under qemu, so it takes longer than aarch64.
|
||||
- Not tested yet: the export and App Store upload of an archive from this workflow; check the exported app with `codesign -d --entitlements - --xml Payload/SimpleX.app` and the same for `PlugIns/*.appex`.
|
||||
Reference in new issue
Block a user