Ensure free-threaded test sessions run under the correct version of P… #1318
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Create instawow executables | |
on: [push, workflow_dispatch] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
FORCE_COLOR: "1" | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build-packages: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.build-packages.outputs.version }} | |
steps: | |
- name: Clone the repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Build packages | |
id: build-packages | |
uses: ./.github/actions/build-packages | |
freeze-cli: | |
needs: build-packages | |
strategy: | |
fail-fast: false | |
matrix: | |
build-env: | |
- os: macos-12 | |
target: aarch64-apple-darwin | |
- os: macos-12 | |
target: x86_64-apple-darwin | |
- os: ubuntu-22.04 | |
target: aarch64-unknown-linux-gnu | |
- os: ubuntu-22.04 | |
target: x86_64-unknown-linux-gnu | |
# - os: windows-2022 | |
# target: aarch64-pc-windows-msvc | |
- os: windows-2022 | |
target: x86_64-pc-windows-msvc | |
runs-on: ${{ matrix.build-env.os }} | |
steps: | |
- name: Clone the repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download pre-built packages | |
uses: actions/download-artifact@v4 | |
with: | |
name: packages | |
path: ./dist | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Install Python 3.11 | |
run: uv python install 3.11 | |
- name: Install Rust | |
run: rustup update stable | |
- name: Install cross-compilation toolchain | |
uses: taiki-e/setup-cross-toolchain-action@v1 | |
with: | |
target: ${{ matrix.build-env.target }} | |
- name: Install cross | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cross | |
if: startsWith(matrix.build-env.os, 'ubuntu-') | |
- name: Install nox | |
run: uv tool install nox | |
- name: Freeze the CLI | |
id: freeze-cli | |
run: nox -s freeze_cli -- --out-dir ./cli | |
env: | |
CARGO_BUILD_TARGET: ${{ matrix.build-env.target }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: instawow-cli-${{ needs.build-packages.outputs.version }}-${{ matrix.build-env.target }} | |
path: ./cli/instawow* | |
freeze-gui: | |
needs: build-packages | |
strategy: | |
matrix: | |
build-env: | |
- os: macos-latest | |
target: universal2-apple-darwin | |
python-version: "3.12" | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
python-version: "3.12" | |
# Won't work while GHA doesn't support ARM | |
# - os: ubuntu-latest | |
# target: aarch64-unknown-linux-gnu | |
# container: | |
# image: quay.io/pypa/musllinux_1_2_aarch64 | |
# options: --privileged | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
python-version: "3.12" | |
fail-fast: false | |
runs-on: ${{ matrix.build-env.os }} | |
container: ${{ matrix.build-env.container }} | |
steps: | |
- name: Clone the repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download pre-built packages | |
uses: actions/download-artifact@v4 | |
with: | |
name: packages | |
path: ./dist | |
- name: Install briefcase Linux dependencies | |
run: sudo apt-get update --fix-missing && sudo apt-get install -y flatpak-builder | |
if: matrix.build-env.python-version && startsWith(matrix.build-env.os, 'ubuntu-') | |
- name: Install briefcase Linux dependencies (Alpine) | |
run: apk add flatpak-builder | |
if: matrix.build-env.container | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Install Python ${{ matrix.build-env.python-version }} | |
run: uv python install ${{ matrix.build-env.python-version }} | |
if: matrix.build-env.python-version | |
- name: Install nox | |
run: uv tool install nox | |
if: matrix.build-env.python-version | |
- name: Install nox (Alpine) | |
run: /opt/python/cp312-cp312/bin/python -m pip install nox | |
if: matrix.build-env.container | |
- name: Freeze the GUI | |
run: >- | |
nox | |
--error-on-missing-interpreters | |
--force-python ${{ matrix.build-env.python-version }} | |
-s freeze_gui-${{ matrix.build-env.python-version }} | |
-- | |
${{ startsWith(github.ref, 'refs/tags/') && '--release' || '' }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: instawow-gui-${{ needs.build-packages.outputs.version }}-${{ matrix.build-env.target }} | |
path: | | |
instawow-gui/dist/instawow-gui-* | |
if-no-files-found: error | |
create-release: | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: [freeze-cli, freeze-gui] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download built artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: release-assets | |
- name: Zip up CLI directories | |
run: | | |
set +x | |
for d in instawow-cli-* | |
do | |
zip -r "${d%/}.zip" "$d" | |
done | |
working-directory: release-assets | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
files: | | |
release-assets/instawow-cli-*.zip | |
release-assets/instawow-gui-*/* |