Skip to content

Commit

Permalink
Fix apphost CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Popax21 committed Apr 21, 2024
1 parent a50b760 commit cb067d2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 28 deletions.
50 changes: 23 additions & 27 deletions .github/workflows/build-apphost.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,40 @@ jobs:
build:
strategy:
matrix:
ui:
- none
- cli
- gui

targets:
- os: windows-latest
target:
- name: win_x86
os: windows-latest
target: i686-pc-windows-msvc
target_name: win_x86
exec_suffix: .exe

- os: windows-latest
- name: win_x64
os: windows-latest
target: x86_64-pc-windows-msvc
target_name: win_64
exec_suffix: .exe

- os: ubuntu-latest
- name: linux_x64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
target_name: linux_x64

#https://kobzol.github.io/rust/ci/2021/05/07/building-rust-binaries-in-ci-that-work-with-older-glibc.html
container: quay.io/pypa/manylinux_2_28_x86_64
container: quay.io/pypa/manylinux_2_28_x86_64 #https://kobzol.github.io/rust/ci/2021/05/07/building-rust-binaries-in-ci-that-work-with-older-glibc.html

- os: macos-latest
- name: macos_x64
os: macos-latest
target: x86_64-apple-darwin
target_name: macos_x64

args:
name: piton-linux_x64
ui:
- none
- cli
- gui

include:
# Linux GUI support needs libgtk-3-dev to be installed
- target_name: linux_x64
- target.name: linux_x64
ui: gui
apt_deps: libgtk-3-dev

runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
runs-on: ${{ matrix.target.os }}
container: ${{ matrix.target.container }}
steps:
- uses: actions/checkout@v4

Expand All @@ -73,23 +69,23 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
apphost/target/
key: ${{ runner.os }}-${{ matrix.container }}-apphost-cargo-${{ hashFiles('apphost/Cargo.toml') }}
key: ${{ runner.os }}-${{ runner.container }}-apphost-cargo-${{ hashFiles('apphost/Cargo.toml') }}
restore-keys:
${{ runner.os }}-${{ matrix.container }}-apphost-cargo-
${{ runner.os }}-${{ runner.container }}-apphost-cargo-

- name: Setup Rust toolchain
if: ${{ !steps.cache.outputs.cache-hit }}
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --profile minimal -y

- name: Build Piton binary
working-directory: apphost
run: ~/.cargo/bin/cargo build --verbose --release --target ${{ matrix.target }} -F ui-${{ matrix.ui }}
run: ~/.cargo/bin/cargo build --verbose --release --target ${{ matrix.target.target }} -F ui-${{ matrix.ui }}

- run: mv apphost/target/${{ matrix.target }}/release/piton${{ matrix.exec_suffix }} piton-${{ matrix.target_name }}-${{ matrix.ui }}${{ matrix.exec_suffix }}
- run: mv apphost/target/${{ matrix.target.target }}/release/piton${{ matrix.target.exec_suffix }} piton-${{ matrix.target.name }}-${{ matrix.ui }}${{ matrix.target.exec_suffix }}

- name: Upload Piton binary
uses: actions/upload-artifact@v4
with:
name: apphost-${{ matrix.target_name }}-${{ matrix.ui }}
path: piton-${{ matrix.target_name }}-${{ matrix.ui }}${{ matrix.exec_suffix }}
name: apphost-${{ matrix.target.name }}-${{ matrix.ui }}
path: piton-${{ matrix.target.name }}-${{ matrix.ui }}${{ matrix.target.exec_suffix }}
if-no-files-found: error
2 changes: 1 addition & 1 deletion .github/workflows/build-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/cache/restore@v4
id: cache-check
with:
key: apphost-binaries-${{ hashFiles('apphost') }}
key: apphost-binaries-${{ hashFiles('apphost', '.github/workflows/build-apphost.yml') }}
path: apphost
lookup-only: true

Expand Down

0 comments on commit cb067d2

Please sign in to comment.