mirror of
https://github.com/vrc-get/vrc-get.git
synced 2026-06-28 10:02:10 +00:00
123 lines
4.3 KiB
YAML
123 lines
4.3 KiB
YAML
name: CI (Build GUI)
|
|
|
|
on:
|
|
push:
|
|
branches: [ "master" ]
|
|
pull_request:
|
|
branches: [ "master" ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
# workaround of https://github.com/tauri-apps/tauri-action/issues/1091
|
|
TAURI_BUNDLER_DMG_IGNORE_CI: false
|
|
|
|
jobs:
|
|
build-gui:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- triple: x86_64-unknown-linux-gnu
|
|
on: ubuntu-22.04
|
|
setup: |
|
|
sudo apt update && sudo apt install -y lld
|
|
ld.lld --version
|
|
|
|
sudo apt update && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
|
|
rustflags: "-C link-arg=-fuse-ld=lld"
|
|
|
|
- triple: x86_64-pc-windows-msvc
|
|
on: windows-latest
|
|
|
|
- triple: universal-apple-darwin
|
|
on: macos-14
|
|
setup: |
|
|
rustup target add aarch64-apple-darwin
|
|
rustup target add x86_64-apple-darwin
|
|
triple:
|
|
- x86_64-unknown-linux-gnu
|
|
#- aarch64-unknown-linux-gnu
|
|
- x86_64-pc-windows-msvc
|
|
#- aarch64-pc-windows-msvc
|
|
- universal-apple-darwin
|
|
|
|
runs-on: ${{ matrix.on }}
|
|
env:
|
|
RUSTFLAGS: ${{ matrix.rustflags }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
- run: rustup update stable
|
|
- name: Install cross-compilation tools
|
|
uses: taiki-e/setup-cross-toolchain-action@v1
|
|
if: ${{ matrix.triple != 'universal-apple-darwin' }}
|
|
with:
|
|
target: ${{ matrix.triple }}
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
key: ci-build-gui-${{ matrix.triple }}
|
|
- name: Cache javascript essentials
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.npm
|
|
${{ github.workspace }}/vrc-get-gui/.next/cache
|
|
${{ github.workspace }}/vrc-get-gui/build
|
|
key: ${{ runner.os }}-nextjs-${{ hashFiles('vrc-get-gui/package-lock.json') }}-${{ hashFiles('vrc-get-gui/**/*.js', 'vrc-get-gui/**/*.jsx', 'vrc-get-gui/**/*.ts', 'vrc-get-gui/**/*.tsx') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-nextjs-${{ hashFiles('vrc-get-gui/package-lock.json') }}-
|
|
|
|
- name: Setup
|
|
run: ${{ matrix.setup }}
|
|
|
|
- name: add commit hash to version name
|
|
id: version
|
|
shell: bash
|
|
run: |
|
|
VERSION="$(cargo metadata --format-version 1 --no-deps | jq --raw-output '.packages[] | select(.name == "vrc-get-gui") | .version')"
|
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
cp vrc-get-gui/Cargo.toml vrc-get-gui/Cargo.toml.bak
|
|
sed -E "/^version/s/\"$/+$(git rev-parse --short HEAD)\"/" < vrc-get-gui/Cargo.toml.bak > vrc-get-gui/Cargo.toml
|
|
|
|
- name: disable bundling updater
|
|
shell: bash
|
|
run: |
|
|
cp vrc-get-gui/Tauri.toml vrc-get-gui/Tauri.toml.bak
|
|
grep -v "remove if ci" < vrc-get-gui/Tauri.toml.bak > vrc-get-gui/Tauri.toml
|
|
|
|
- name: Enable Devtools Feature
|
|
shell: bash
|
|
run: |
|
|
cargo add --package vrc-get-gui tauri --features devtools
|
|
|
|
- uses: tauri-apps/tauri-action@v0
|
|
with:
|
|
projectPath: vrc-get-gui
|
|
tauriScript: npm run tauri
|
|
args: |
|
|
--target ${{ matrix.triple }} -c '{"version":"${{ steps.version.outputs.version }}", "bundle":{"windows":{"certificateThumbprint": null}}}' ${{ (secrets.ACTIONS_STEP_DEBUG || vars.ACTIONS_STEP_DEBUG) == 'true' && '--verbose' || '' }}
|
|
|
|
- name: Upload built binary
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.triple }}
|
|
path: |
|
|
target/${{ matrix.triple }}/release/vrc-get*
|
|
target/${{ matrix.triple }}/release/ALCOM*
|
|
target/${{ matrix.triple }}/release/alcom*
|
|
target/${{ matrix.triple }}/release/bundle/*/vrc-get*
|
|
target/${{ matrix.triple }}/release/bundle/*/ALCOM*
|
|
target/${{ matrix.triple }}/release/bundle/*/alcom*
|
|
|
|
conclude-gui:
|
|
runs-on: ubuntu-latest
|
|
if: ${{ always() }}
|
|
needs: [ build-gui ]
|
|
steps:
|
|
- name: Conclude Tests
|
|
env: { NEEDS: "${{ toJSON(needs) }}" }
|
|
run: |
|
|
echo "$NEEDS" | jq -c '. | to_entries[] | [.key, .value.result]'
|
|
echo "$NEEDS" | jq -e '. | all(.result == "success")' > /dev/null
|