Merge pull request #999 from vrc-get/ci-use-github-app-for-labeler #1212
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: CI (Build GUI) | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-gui: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- triple: x86_64-unknown-linux-gnu | |
on: ubuntu-latest | |
setup: | | |
sudo apt update && sudo apt install -y lld | |
ld.lld --version | |
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-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 | |
- 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 }} | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.2xx | |
- 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') }}- | |
- uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-about | |
- 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 | |
- uses: tauri-apps/tauri-action@v0 | |
with: | |
projectPath: vrc-get-gui | |
tauriScript: npm run tauri | |
args: | | |
--target ${{ matrix.triple }} -c '{"tauri":{"updater":{"active":false}},"package":{"version":"${{ steps.version.outputs.version }}"}}' | |
- 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 |