Try building flatpaks #1225
Workflow file for this run
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-package: | |
runs-on: ubuntu-latest | |
outputs: | |
wheel-name: ${{ steps.build-package.outputs.wheel-name }} | |
wheel-version: ${{ steps.build-package.outputs.wheel-version }} | |
steps: | |
- name: Clone the repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Build package | |
id: build-package | |
uses: ./.github/actions/build-package | |
freeze-cli: | |
needs: build-package | |
strategy: | |
fail-fast: false | |
matrix: | |
build-env: | |
- os: macos-12 | |
rust-target: aarch64-apple-darwin | |
- os: macos-12 | |
rust-target: x86_64-apple-darwin | |
- os: ubuntu-22.04 | |
rust-target: aarch64-unknown-linux-gnu | |
- os: ubuntu-22.04 | |
rust-target: x86_64-unknown-linux-gnu | |
# - os: windows-2022 | |
# rust-target: aarch64-pc-windows-msvc | |
- os: windows-2022 | |
rust-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 wheel | |
uses: actions/download-artifact@v3 | |
id: download-wheel | |
with: | |
name: ${{ needs.build-package.outputs.wheel-name }} | |
path: ./dist | |
- name: Install Python 3.11 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "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.rust-target }} | |
- name: Install cross | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cross | |
if: startsWith(matrix.build-env.os, 'ubuntu-') | |
- name: Install nox | |
run: pipx install nox uv | |
- name: Freeze the CLI | |
run: nox -s freeze_cli -- | |
--wheel-file '${{ steps.download-wheel.outputs.download-path }}/${{ needs.build-package.outputs.wheel-name }}' | |
--out-dir ./dist-cli | |
env: | |
CARGO_BUILD_TARGET: ${{ matrix.build-env.rust-target }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: instawow-cli-${{ needs.build-package.outputs.wheel-version }}-${{ matrix.build-env.rust-target }} | |
path: ./dist-cli/instawow* | |
freeze-gui: | |
needs: build-package | |
strategy: | |
matrix: | |
build-env: | |
- os: macos-12 | |
python-version: "3.12" | |
briefcase-build-opts: "" | |
briefcase-package-opts: "--adhoc-sign" | |
- os: ubuntu-22.04 | |
container: | |
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-44 | |
options: --privileged | |
python-version: "3.12" | |
briefcase-build-opts: "linux flatpak" | |
briefcase-package-opts: "linux flatpak" | |
- os: windows-2022 | |
python-version: "3.12" | |
briefcase-build-opts: "" | |
briefcase-package-opts: "" | |
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 wheel | |
uses: actions/download-artifact@v3 | |
id: download-wheel | |
with: | |
name: ${{ needs.build-package.outputs.wheel-name }} | |
path: ./dist | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.build-env.python-version }} | |
- name: Install nox and briefcase | |
run: | | |
python -m venv .venv | |
.venv/bin/pip install nox 'briefcase @ git+https://github.com/layday/briefcase@instawow' | |
- name: Patch in the version and wheel | |
run: >- | |
.venv/bin/nox -s patch_frontend_spec -- | |
${{ startsWith(github.ref, 'refs/tags/') && '--version ${{ needs.build-package.outputs.wheel-version }}' || ''}} | |
--wheel-file '${{ steps.download-wheel.outputs.download-path }}/${{ needs.build-package.outputs.wheel-name }}' | |
- name: Run briefcase | |
run: | | |
../.venv/bin/briefcase build ${{ matrix.build-env.briefcase-build-opts }} | |
../.venv/bin/briefcase package ${{ matrix.build-env.briefcase-package-opts }} | |
working-directory: instawow-gui | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: instawow-gui-${{ needs.build-package.outputs.wheel-version }}-${{ matrix.build-env.os }} | |
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@v3 | |
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-*/* |