Add Linux builds via GitHub Actions, switch reqwest to rustls-tls #1
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: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| artifact: mochify-macos-arm64 | |
| - target: x86_64-apple-darwin | |
| os: macos-13 | |
| artifact: mochify-macos-x86_64 | |
| - target: x86_64-unknown-linux-musl | |
| os: ubuntu-latest | |
| artifact: mochify-linux-x86_64 | |
| - target: aarch64-unknown-linux-musl | |
| os: ubuntu-latest | |
| artifact: mochify-linux-arm64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install musl tools | |
| if: contains(matrix.target, 'musl') | |
| run: | | |
| sudo apt-get update -q | |
| sudo apt-get install -y musl-tools | |
| if [ "${{ matrix.target }}" = "aarch64-unknown-linux-musl" ]; then | |
| sudo apt-get install -y gcc-aarch64-linux-gnu | |
| fi | |
| - name: Build | |
| env: | |
| CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: aarch64-linux-gnu-gcc | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Rename binary | |
| run: cp target/${{ matrix.target }}/release/mochify ${{ matrix.artifact }} | |
| - name: Upload to release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: ${{ matrix.artifact }} |