name: Build on: [push] permissions: contents: write env: RUST_TOOLCHAIN: 1.86.0 jobs: build: name: Build (${{ matrix.target }}) env: VCPKG_SYSTEM_LIBRARIES: "OFF" strategy: fail-fast: false matrix: include: - os: ubuntu-latest target: x86_64-unknown-linux-gnu artifact_name: pacman - os: macos-13 target: x86_64-apple-darwin artifact_name: pacman - os: macos-latest target: aarch64-apple-darwin artifact_name: pacman - os: windows-latest target: x86_64-pc-windows-gnu artifact_name: pacman.exe runs-on: ${{ matrix.os }} steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Rust Toolchain uses: dtolnay/rust-toolchain@master with: target: ${{ matrix.target }} toolchain: ${{ env.RUST_TOOLCHAIN }} - name: Rust Cache uses: Swatinem/rust-cache@v2 - name: Cache vcpkg uses: actions/cache@v4 with: path: target/vcpkg key: ${{ runner.os }}-vcpkg-${{ hashFiles('Cargo.toml', 'Cargo.lock') }} restore-keys: | ${{ runner.os }}-vcpkg- - name: Vcpkg Linux Dependencies if: runner.os == 'Linux' run: | sudo apt-get update sudo apt-get install -y build-essential gettext libltdl-dev - name: Vcpkg run: | cargo install cargo-vcpkg cargo vcpkg -v build - name: Build run: cargo build --release - name: Acquire Package Version shell: bash run: | PACKAGE_VERSION=$(cargo metadata --format-version 1 --no-deps | jq '.packages[0].version' -r) echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV - name: Upload Artifact uses: actions/upload-artifact@v4 with: name: "pacman-${{ env.PACKAGE_VERSION }}-${{ matrix.target }}" path: ./target/release/${{ matrix.artifact_name }} retention-days: 7 if-no-files-found: error wasm: name: Build (wasm32-unknown-emscripten) runs-on: ubuntu-latest permissions: pages: write id-token: write steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Emscripten SDK uses: mymindstorm/setup-emsdk@v14 with: version: 3.1.43 actions-cache-folder: "emsdk-cache" - name: Setup Rust (WASM32 Emscripten) uses: dtolnay/rust-toolchain@master with: target: wasm32-unknown-emscripten toolchain: ${{ env.RUST_TOOLCHAIN }} - name: Rust Cache uses: Swatinem/rust-cache@v2 - name: Install pnpm uses: pnpm/action-setup@v3 with: version: 8 run_install: true - name: Build run: ./build.sh -er # release mode, skip emsdk - name: Upload Artifact uses: actions/upload-pages-artifact@v3 with: path: "./dist/" retention-days: 7 - name: Deploy uses: actions/deploy-pages@v4