|
| 1 | +name: Build release binaries |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +jobs: |
| 7 | + build_native: |
| 8 | + runs-on: ${{ matrix.os }} |
| 9 | + strategy: |
| 10 | + fail-fast: false |
| 11 | + matrix: |
| 12 | + include: |
| 13 | + - os: macos-latest |
| 14 | + arch: arm64 |
| 15 | + target: aarch64-apple-darwin |
| 16 | + platform: macosx_arm64 |
| 17 | + - os: macos-latest |
| 18 | + arch: x86_64 |
| 19 | + target: x86_64-apple-darwin |
| 20 | + platform: macosx_x86_64 |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v2 |
| 23 | + - name: Setup rust toolchain |
| 24 | + uses: actions-rs/toolchain@v1 |
| 25 | + with: |
| 26 | + toolchain: stable |
| 27 | + target: ${{ matrix.target }} |
| 28 | + - name: Setup build directory |
| 29 | + run: mkdir builds |
| 30 | + - name: Build |
| 31 | + uses: actions-rs/cargo@v1 |
| 32 | + with: |
| 33 | + command: build |
| 34 | + args: --release --target=${{ matrix.target }} |
| 35 | + - name: Copy |
| 36 | + run: cp target/${{ matrix.target }}/release/libviam.dylib builds/libviam-${{ matrix.platform }}.dylib |
| 37 | + - name: Upload artifacts |
| 38 | + uses: actions/upload-artifact@v3 |
| 39 | + with: |
| 40 | + name: builds |
| 41 | + path: builds |
| 42 | + |
| 43 | + build_in_container: |
| 44 | + runs-on: ${{ matrix.arch }} |
| 45 | + container: |
| 46 | + image: ${{ matrix.image }} |
| 47 | + options: ${{ matrix.opts }} |
| 48 | + strategy: |
| 49 | + fail-fast: false |
| 50 | + matrix: |
| 51 | + include: |
| 52 | + - arch: [arm64, qemu-host] |
| 53 | + target: aarch64-unknown-linux-gnu |
| 54 | + platform: linux_aarch64 |
| 55 | + ext: so |
| 56 | + image: 'ghcr.io/viamrobotics/canon:arm64-cache' |
| 57 | + opts: '--platform linux/arm64' |
| 58 | + - arch: [x64, qemu-host] |
| 59 | + target: x86_64-unknown-linux-gnu |
| 60 | + platform: linux_x86_64 |
| 61 | + ext: so |
| 62 | + image: 'ghcr.io/viamrobotics/canon:amd64-cache' |
| 63 | + opts: '--platform linux/amd64' |
| 64 | + steps: |
| 65 | + - uses: actions/checkout@v2 |
| 66 | + - name: Setup rust toolchain |
| 67 | + uses: actions-rs/toolchain@v1 |
| 68 | + with: |
| 69 | + toolchain: stable |
| 70 | + target: ${{ matrix.target }} |
| 71 | + - name: Setup build directory |
| 72 | + run: mkdir builds |
| 73 | + - name: Build |
| 74 | + uses: actions-rs/cargo@v1 |
| 75 | + with: |
| 76 | + command: build |
| 77 | + args: --release --target=${{ matrix.target }} |
| 78 | + - name: Copy |
| 79 | + run: cp target/${{ matrix.target }}/release/libviam.${{ matrix.ext }} builds/libviam-${{ matrix.platform }}.${{ matrix.ext }} |
| 80 | + - name: Upload artifacts |
| 81 | + uses: actions/upload-artifact@v3 |
| 82 | + with: |
| 83 | + name: builds |
| 84 | + path: builds |
0 commit comments