name: Build on: push: tags: - v* permissions: contents: write env: CARGO_INCREMENTAL: 0 jobs: build: name: ${{ matrix.target }} runs-on: ${{ matrix.os }} defaults: run: shell: bash strategy: fail-fast: true matrix: include: - os: ubuntu-latest target: x86_64-unknown-linux-gnu deb: true - os: ubuntu-latest target: i686-unknown-linux-gnu deb: true cross: true - os: ubuntu-latest target: aarch64-unknown-linux-gnu deb: true cross: true - os: ubuntu-latest target: armv7-unknown-linux-gnueabihf deb: true cross: true - os: ubuntu-latest target: aarch64-linux-android cross: true - os: macos-latest target: x86_64-apple-darwin - os: macos-latest target: aarch64-apple-darwin - os: windows-latest target: x86_64-pc-windows-msvc - os: windows-latest target: aarch64-pc-windows-msvc steps: - uses: actions/checkout@v4 - name: get version id: version run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT - name: setup Rust toolchain uses: actions-rs/toolchain@v1 with: toolchain: stable override: true target: ${{ matrix.target }} profile: minimal - name: caching uses: Swatinem/rust-cache@v2 with: key: ${{ matrix.target }} - name: build if: ${{ matrix.cross != true}} run: cargo build --release --locked --target ${{ matrix.target }} - name: build (cross) if: ${{ matrix.cross == true}} # cross 0.2.5 broken for android run: | cargo install cross --locked --git https://github.com/cross-rs/cross --rev 99b8069c0d977a14cd421ad8a3ef3255dc5802be cross build --release --no-default-features --locked --target ${{ matrix.target }} - name: package deb if: ${{ matrix.deb == true }} run: | cargo install cargo-deb --locked cargo deb -p pay-respects --no-build --no-strip --output . --target ${{ matrix.target }} - name: zipping files (exe) if: runner.os == 'Windows' run: > 7z a pay-respects-${{ steps.version.outputs.VERSION }}-${{ matrix.target }}.zip ./target/${{ matrix.target }}/release/pay-respects.exe ./target/${{ matrix.target }}/release/_pay-respects-module-100-runtime-rules.exe ./target/${{ matrix.target }}/release/_pay-respects-fallback-100-request-ai.exe - name: zipping files (unix) if: runner.os != 'Windows' run: > tar -czf pay-respects-${{ steps.version.outputs.VERSION }}-${{ matrix.target }}.tar.gz -C target/${{ matrix.target }}/release pay-respects _pay-respects-module-100-runtime-rules _pay-respects-fallback-100-request-ai - name: uploading to release uses: ncipollo/release-action@v1 with: artifacts: | *.tar.gz *.zip *.deb allowUpdates: true makeLatest: true