v0.2.1 #7
Workflow file for this run
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
| name: release | |
| on: | |
| release: | |
| types: [published] | |
| env: | |
| RUST_VERSION: "1.83.0" | |
| jobs: | |
| release: | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: write | |
| env: | |
| ASSET: "" | |
| CARGO: cargo | |
| strategy: | |
| matrix: | |
| build: | |
| - freebsd-x86_64 | |
| - linux-arm64-gnu | |
| - linux-arm64-musl | |
| - linux-x86_64-gnu | |
| - linux-x86_64-musl | |
| - macos-arm64 | |
| - macos-x86_64 | |
| - windows-x86_64-msvc | |
| include: | |
| - build: freebsd-x86_64 | |
| os: ubuntu-22.04 | |
| target: x86_64-unknown-freebsd | |
| - build: linux-arm64-gnu | |
| os: ubuntu-22.04 | |
| target: aarch64-unknown-linux-gnu | |
| - build: linux-arm64-musl | |
| os: ubuntu-22.04 | |
| target: aarch64-unknown-linux-musl | |
| - build: linux-x86_64-gnu | |
| os: ubuntu-22.04 | |
| target: x86_64-unknown-linux-gnu | |
| - build: linux-x86_64-musl | |
| os: ubuntu-22.04 | |
| target: x86_64-unknown-linux-musl | |
| - build: macos-x86_64 | |
| os: macos-14 | |
| target: x86_64-apple-darwin | |
| - build: macos-arm64 | |
| os: macos-14 | |
| target: aarch64-apple-darwin | |
| - build: windows-x86_64-msvc | |
| os: windows-2022 | |
| target: x86_64-pc-windows-msvc | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ env.RUST_VERSION }} | |
| target: ${{ matrix.target }} | |
| - name: Update git submodules | |
| run: git submodule update --init | |
| - name: Install cross | |
| if: ${{ matrix.os == 'ubuntu-22.04' }} | |
| run: | | |
| cargo install cross --git https://github.com/cross-rs/cross | |
| echo CARGO=cross >> $GITHUB_ENV | |
| - name: Rust cargo build | |
| run: ${{ env.CARGO }} build --release --locked --target ${{ matrix.target }} | |
| - name: Build archive | |
| if: ${{ matrix.os != 'windows-2022' }} | |
| shell: bash | |
| run: | | |
| staging="fetch-${{ github.ref_name }}-${{ matrix.target }}" | |
| cp "target/${{ matrix.target }}/release/fetch" fetch | |
| tar czf "$staging.tar.gz" fetch | |
| echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV | |
| - name: Build archive | |
| if: ${{ matrix.os == 'windows-2022' }} | |
| shell: bash | |
| run: | | |
| staging="fetch-${{ github.ref_name }}-${{ matrix.target }}" | |
| cp "target/${{ matrix.target }}/release/fetch.exe" fetch.exe | |
| 7z a "$staging.zip" fetch.exe | |
| echo "ASSET=$staging.zip" >> $GITHUB_ENV | |
| - name: Upload release archive | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: gh release upload ${{ github.ref_name }} ${{ env.ASSET }} | |
| latest: | |
| runs-on: "ubuntu-latest" | |
| needs: release | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Mark release as latest | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: gh release edit ${{ github.ref_name }} --latest |