more #112
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: Build | |
on: [push] | |
jobs: | |
build: | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
arch: linux-x86_64 | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
arch: windows-x86_64 | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
arch: macos-x86_64 | |
- os: macos-latest | |
target: aarch64-apple-darwin | |
arch: macos-aarch64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: install Rust nightly | |
uses: dtolnay/rust-toolchain@nightly | |
- name: Fix Rust | |
run: rustup update | |
- name: Target | |
run: rustup target add ${{ matrix.target }} | |
- name: Rust cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Binstall | |
uses: cargo-bins/cargo-binstall@main | |
- name: Cross & Zigbuild | |
run: | | |
cargo binstall -y cross | |
cargo binstall -y cargo-zigbuild | |
- name: Install system dependencies | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
libgtk-3-dev \ | |
libwebkit2gtk-4.0-dev \ | |
libappindicator3-dev \ | |
librsvg2-dev \ | |
patchelf | |
- name: Install pnpm | |
run: npm i -g pnpm | |
- name: Install frontend dependencies | |
run: pnpm install | |
- uses: benjlevesque/short-sha@v2.1 | |
id: short-sha | |
with: | |
length: 7 | |
- name: Run conf | |
if: matrix.os != 'windows-latest' | |
run: ./apps/gui/genconf.sh | |
- name: Run conf | |
if: matrix.os == 'windows-latest' | |
run: .\apps\gui\genconf.ps1 | |
- name: Run primsa | |
if: matrix.os != 'windows-latest' | |
run: cargo prisma generate | |
- name: Run prisma | |
if: matrix.os == 'windows-latest' | |
run: cargo run -p prisma-cli --release -- generate | |
- name: Build app | |
run: | | |
touch .env | |
pnpm run build --target ${{ matrix.target }} | |
pnpm run app:build | |
pnpm run web:build | |
cargo build --release --target ${{ matrix.target }} | |
env: | |
CURSEFORGE_KEY: ${{ secrets.CURSEFORGE_KEY }} | |
MSA_CLIENT_SECRET: ${{ secrets.MSA_CLIENT_SECRET }} | |
NEXUS_API_KEY: ${{ secrets.NEXUS_API_KEY }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: Binaries (${{ matrix.arch }}) | |
path: | | |
target/${{ matrix.target }}/release/wormhole | |
target/${{ matrix.target }}/release/wormhole_gui | |
target/${{ matrix.target }}/release/wormhole_cli | |
target/${{ matrix.target }}/release/bindings | |
target/${{ matrix.target }}/release/webui | |
target/${{ matrix.target }}/release/*.exe | |
target/${{ matrix.target }}/release/bundle/**/*.tar.gz | |
target/${{ matrix.target }}/release/bundle/**/*.tar.gz.sig | |
target/${{ matrix.target }}/release/bundle/**/*.dmg | |
target/${{ matrix.target }}/release/bundle/**/*.AppImage | |
target/${{ matrix.target }}/release/bundle/**/*.AppImage.tar.gz | |
target/${{ matrix.target }}/release/bundle/**/*.AppImage.tar.gz.sig | |
target/${{ matrix.target }}/release/bundle/**/*.deb | |
target/${{ matrix.target }}/release/bundle/**/*.rpm | |
target/${{ matrix.target }}/release/bundle/**/*.msi | |
target/${{ matrix.target }}/release/bundle/**/*.msi.zip | |
target/${{ matrix.target }}/release/bundle/**/*.msi.zip.sig | |
target/${{ matrix.target }}/release/bundle/**/*.nsis.zip | |
target/${{ matrix.target }}/release/bundle/**/*.nsis.zip.sig |