|
| 1 | +name: Build PR |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + types: [ opened, edited, reopened, review_requested ] |
| 5 | + branches: [ master ] |
| 6 | + |
| 7 | +env: |
| 8 | + CARGO_TERM_COLOR: always |
| 9 | + |
| 10 | +jobs: |
| 11 | + build-cross: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + env: |
| 14 | + RUST_BACKTRACE: full |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + target: |
| 18 | + - x86_64-unknown-linux-musl |
| 19 | + - aarch64-unknown-linux-musl |
| 20 | + |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v2 |
| 23 | + |
| 24 | + - name: Install cross |
| 25 | + run: cargo install cross |
| 26 | + |
| 27 | + - name: Build ${{ matrix.target }} |
| 28 | + timeout-minutes: 120 |
| 29 | + run: | |
| 30 | + compile_target=${{ matrix.target }} |
| 31 | +
|
| 32 | + cd build |
| 33 | + ./build-release -t ${{ matrix.target }} $compile_features $compile_compress |
| 34 | +
|
| 35 | + build-unix: |
| 36 | + runs-on: ${{ matrix.os }} |
| 37 | + env: |
| 38 | + RUST_BACKTRACE: full |
| 39 | + strategy: |
| 40 | + matrix: |
| 41 | + os: [macos-latest] |
| 42 | + target: |
| 43 | + - x86_64-apple-darwin |
| 44 | + - aarch64-apple-darwin |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@v2 |
| 47 | + |
| 48 | + - name: Install GNU tar |
| 49 | + if: runner.os == 'macOS' |
| 50 | + run: | |
| 51 | + brew install gnu-tar |
| 52 | + # echo "::add-path::/usr/local/opt/gnu-tar/libexec/gnubin" |
| 53 | + echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH |
| 54 | +
|
| 55 | + - name: Install Rust stable |
| 56 | + uses: actions-rs/toolchain@v1 |
| 57 | + with: |
| 58 | + profile: minimal |
| 59 | + toolchain: stable |
| 60 | + target: ${{ matrix.target }} |
| 61 | + default: true |
| 62 | + override: true |
| 63 | + |
| 64 | + - name: Build release |
| 65 | + shell: bash |
| 66 | + run: | |
| 67 | + ./build/build-host-release -t ${{ matrix.target }} |
| 68 | +
|
| 69 | + build-windows: |
| 70 | + runs-on: windows-latest |
| 71 | + env: |
| 72 | + RUSTFLAGS: "-Ctarget-feature=+crt-static" |
| 73 | + RUST_BACKTRACE: full |
| 74 | + steps: |
| 75 | + - uses: actions/checkout@v2 |
| 76 | + |
| 77 | + - name: Install Rust stable |
| 78 | + uses: actions-rs/toolchain@v1 |
| 79 | + with: |
| 80 | + profile: minimal |
| 81 | + toolchain: stable |
| 82 | + default: true |
| 83 | + override: true |
| 84 | + |
| 85 | + - name: Build release |
| 86 | + run: | |
| 87 | + pwsh ./build/build-host-release.ps1 |
| 88 | +
|
| 89 | + - name: Upload Artifacts |
| 90 | + uses: actions/upload-artifact@v2 |
| 91 | + with: |
| 92 | + name: windows-native |
| 93 | + path: build/release/* |
0 commit comments