fix: enable default features for reqwest #113
This file contains hidden or 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
| # SPDX-FileCopyrightText: 2025 Ryan Cao <hello@ryanccn.dev> | |
| # | |
| # SPDX-License-Identifier: GPL-3.0-or-later | |
| name: Build | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| workflow_call: | |
| inputs: | |
| disable-cache: | |
| type: boolean | |
| default: false | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| permissions: | |
| id-token: write | |
| attestations: write | |
| strategy: | |
| matrix: | |
| target: | |
| - "aarch64-apple-darwin" | |
| - "x86_64-apple-darwin" | |
| - "aarch64-pc-windows-msvc" | |
| - "x86_64-pc-windows-msvc" | |
| include: | |
| - target: "aarch64-apple-darwin" | |
| runner: macos-latest | |
| - target: "x86_64-apple-darwin" | |
| runner: macos-latest | |
| - target: "aarch64-pc-windows-msvc" | |
| runner: windows-latest | |
| - target: "x86_64-pc-windows-msvc" | |
| runner: windows-latest | |
| fail-fast: false | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # ratchet:dtolnay/rust-toolchain@stable | |
| with: | |
| target: ${{ matrix.target }} | |
| - name: Setup Rust cache | |
| uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # ratchet:Swatinem/rust-cache@v2 | |
| if: ${{ inputs.disable-cache != true }} | |
| - name: Install cargo-auditable | |
| uses: taiki-e/install-action@d6e286fa45544157a02d45a43742857ebbc25d12 # ratchet:taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-auditable | |
| - name: Build | |
| run: cargo auditable build --release --locked --target ${{ matrix.target }} | |
| env: | |
| CARGO_PROFILE_RELEASE_LTO: "fat" | |
| CARGO_PROFILE_RELEASE_CODEGEN_UNITS: "1" | |
| - name: Generate build provenance attestations | |
| uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # ratchet:actions/attest-build-provenance@v4 | |
| if: ${{ github.event_name != 'pull_request' }} | |
| with: | |
| subject-path: | | |
| ./target/${{ matrix.target }}/release/arkencrab | |
| ./target/${{ matrix.target }}/release/arkencrab.exe | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # ratchet:actions/upload-artifact@v7 | |
| with: | |
| if-no-files-found: "error" | |
| name: arkencrab-${{ matrix.target }} | |
| path: | | |
| ./target/${{ matrix.target }}/release/arkencrab | |
| ./target/${{ matrix.target }}/release/arkencrab.exe | |
| linux-static: | |
| permissions: | |
| id-token: write | |
| attestations: write | |
| strategy: | |
| matrix: | |
| target: | |
| - "x86_64-unknown-linux-musl" | |
| - "aarch64-unknown-linux-musl" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Install Nix | |
| uses: cachix/install-nix-action@19effe9fe722874e6d46dd7182e4b8b7a43c4a99 # ratchet:cachix/install-nix-action@v31 | |
| - name: Build | |
| run: nix build --fallback --print-build-logs '.#arkencrab-static-${{ matrix.target }}' | |
| - name: Generate build provenance attestations | |
| uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # ratchet:actions/attest-build-provenance@v4 | |
| if: ${{ github.event_name != 'pull_request' }} | |
| with: | |
| subject-path: ./result/bin/arkencrab | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # ratchet:actions/upload-artifact@v7 | |
| with: | |
| if-no-files-found: "error" | |
| name: arkencrab-${{ matrix.target }} | |
| path: ./result/bin/arkencrab |