Skip to content

Pass newtype wrapper of Stylo ComputedValues to Taffy directly (#794) #443

Pass newtype wrapper of Stylo ComputedValues to Taffy directly (#794)

Pass newtype wrapper of Stylo ComputedValues to Taffy directly (#794) #443

name: Publish Browser
on:
push:
branches:
- main
- ci-test/*
workflow_dispatch:
# inputs:
# post:
# name: "Release Post"
# required: true
# description: Choose the release post to publish with. Must be a tag (eg v0.4.0)
# type: string
# channel:
# name: "CLI Binary Version"
# required: true
# description: Choose the version number to publish with. Must be a tag (ie v0.4.0)
# type: string
env:
# make sure we have the right version
# main is always a prepatch until we hit 1.0, and then this script needs to be updated
# note that we need to promote the prepatch to a minor bump when we actually do a release
# this means the version in git will always be one minor bump ahead of the actual release - basically meaning once
# we release a version, it's fair game to merge breaking changes to main since all semver-compatible changes will be
# backported automatically
# SEMVER: ${{ github.event.inputs.channel == 'main' && 'prerelease' || 'patch' }}
# PRERELEASE_TAG: ${{ github.event.inputs.channel == 'main' && '-pre' || '' }}
RELEASE_TAG: ${{ github.event.inputs.channel }}
RELEASE_POST: ${{ github.event.inputs.post }}
# Limit parallism to debug possible OOM
CARGO_BUILD_JOBS: 2
CARGO_LOG: info
jobs:
release-cli:
permissions:
contents: write
runs-on: ${{ matrix.platform.os }}
environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/ci-test')) && 'Signed Builds' || '' }}
name: ${{ matrix.platform.job_name }}
strategy:
fail-fast: false
matrix:
platform:
- job_name: Windows (x86_64)
target: x86_64-pc-windows-msvc
os: windows-latest
use_git_cli: false
artifact_name: "Blitz_0.0.0_windows_x86_64.exe"
artifact_path: ./target/dx/blitz/bundle/windows/nsis/Blitz_0.0.0_x64-setup.exe
- job_name: Windows (aarch64)
target: aarch64-pc-windows-msvc
os: windows-11-arm
use_git_cli: false
artifact_name: "Blitz_0.0.0_windows_aarch64.exe"
artifact_path: ./target/dx/blitz/bundle/windows/nsis/Blitz_0.0.0_arm64-setup.exe
- job_name: macOS (x86_64)
target: x86_64-apple-darwin
os: macos-15-intel
use_git_cli: false
artifact_name: "Blitz_0.0.0_macos_x86_64.dmg"
artifact_path: "./target/dx/blitz/bundle/macos/macos/Blitz_0.0.0_x86_64.dmg"
- job_name: macOS (aarch64)
target: aarch64-apple-darwin
os: macos-latest
use_git_cli: false
artifact_name: "Blitz_0.0.0_macos_aarch64.dmg"
artifact_path: "./target/dx/blitz/bundle/macos/macos/Blitz_0.0.0_aarch64.dmg"
- job_name: Linux (x86_64)
target: x86_64-unknown-linux-gnu
os: ubuntu-24.04
use_git_cli: false
artifact_name: "Blitz_0.0.0_linux_x86_64.AppImage"
artifact_path: ./target/dx/blitz/bundle/linux/appimage/blitz_0.0.0_x86_64.AppImage
- job_name: Linux (aarch64)
target: aarch64-unknown-linux-gnu
os: ubuntu-24.04-arm
use_git_cli: false
artifact_name: "Blitz_0.0.0_linux_aarch64.AppImage"
artifact_path: ./target/dx/blitz/bundle/linux/appimage/blitz_0.0.0_aarch64.AppImage
- job_name: Android (aarch64)
target: aarch64-linux-android
args: --android --package-types apk --no-default-features --features android-defaults
os: ubuntu-24.04
use_git_cli: false
artifact_name: "Blitz_0.0.0_android_aarch64.apk"
artifact_path: ./target/dx/blitz/release/android/app/app/build/outputs/apk/release/Blitz_0.0.0_aarch64.apk
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.96.1"
targets: ${{ matrix.platform.target }}
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: "true"
save-if: ${{ github.ref == 'refs/heads/main' }}
cache-bin: ${{ startsWith(matrix.platform.os, 'macos') }} # works around https://github.com/Swatinem/rust-cache/issues/341
- name: Create Apple private key file
if: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/ci-test')) && startsWith(matrix.platform.os, 'macos') }}
run: echo "${{ secrets.APPLE_API_KEY_CONTENT }}" > ${{ vars.APPLE_API_KEY_PATH }}
- name: Setup Android signing keys
if: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/ci-test')) && matrix.platform.target == 'aarch64-linux-android' }}
run: |
cd apps/browser
base64 -d <<< "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" > keystore.jks
echo '' >> Dioxus.toml
echo '[bundle.android]' >> Dioxus.toml
echo 'jks_file = "./apps/browser/keystore.jks"' >> Dioxus.toml
echo 'jks_password = "${{ secrets.ANDROID_KEY_PASSWORD }}"' >> Dioxus.toml
echo 'key_alias = "upload"' >> Dioxus.toml
echo 'key_password = "${{ secrets.ANDROID_KEY_PASSWORD }}"' >> Dioxus.toml
- name: Install Dioxus CLI
if: ${{ matrix.platform.use_git_cli == false }}
uses: taiki-e/install-action@v2
with:
tool: dioxus-cli@0.7.8
- name: Install Dioxus CLI (git)
if: ${{ matrix.platform.use_git_cli == true }}
run: cargo install dioxus-cli --git https://github.com/nicoburns/dioxus.git --rev=6f7e343a49770e2502ec8169aa9f5d727e1a7773
# - name: Install openssl on macos
# if: ${{ matrix.platform.os == 'macos-latest' || matrix.platform.os == 'macos-15-intel' }}
# run: brew install openssl
# - name: Install nasm for windows (tls)
# if: ${{ matrix.platform.target == 'x86_64-pc-windows-msvc' }}
# uses: ilammy/setup-nasm@v1
- name: Free Disk Space (Ubuntu)
if: ${{ matrix.platform.os == 'ubuntu-24.04' || matrix.platform.os == 'ubuntu-24.04-arm' }}
uses: jlumbroso/free-disk-space@v1.3.1
with: # speed things up a bit
android: ${{ matrix.platform.target != 'aarch64-linux-android' }}
large-packages: false
swap-storage: false
- uses: awalsh128/cache-apt-pkgs-action@latest
if: ${{ startsWith(matrix.platform.os, 'ubuntu') }}
with:
packages: libfontconfig1-dev
version: 1.0
- name: Bundle browser
run: dx bundle --package browser --release --profile production --target ${{ matrix.platform.target }} --locked --verbose --trace ${{ matrix.platform.args }}
env:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_API_ISSUER: ${{ vars.APPLE_API_ISSUER }}
APPLE_API_KEY: ${{ vars.APPLE_API_KEY_ID }}
APPLE_API_KEY_PATH: ${{ vars.APPLE_API_KEY_PATH }}
- name: Post process
if: ${{ matrix.platform.job_name == 'Android (aarch64)' }}
run: |
mv ./target/dx/blitz/release/android/app/app/build/outputs/apk/release/app-release.apk ./target/dx/blitz/release/android/app/app/build/outputs/apk/release/Blitz_0.0.0_aarch64.apk
- name: Delete private key file
if: ${{ always() && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/ci-test')) && startsWith(matrix.platform.os, 'macos') }}
run: rm ${{ vars.APPLE_API_KEY_PATH }}
- name: Delete Android keystore
if: ${{ always() && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/ci-test')) && matrix.platform.target == 'aarch64-linux-android' }}
run: rm ./apps/browser/keystore.jks
- name: Upload app bundle
uses: actions/upload-artifact@v7
if: ${{ matrix.platform.artifact_path != '' && matrix.platform.artifact_name != '' }}
with:
name: ${{ matrix.platform.artifact_name }}
path: ${{ matrix.platform.artifact_path }}
archive: false # Don't zip
# # Todo: we want `cargo install dx` to actually just use a prebuilt binary instead of building it
# - name: Build and upload CLI binaries
# uses: taiki-e/upload-rust-binary-action@v1
# with:
# bin: dx
# token: ${{ secrets.GITHUB_TOKEN }}
# target: ${{ matrix.platform.target }}
# archive: $bin-$target
# checksum: sha256
# manifest_path: packages/cli/Cargo.toml
# ref: refs/tags/${{ env.RELEASE_POST }}
# zip: "all"