|
| 1 | +name: CD # Continuous Deployment |
| 2 | + |
| 3 | +permissions: |
| 4 | + contents: write |
| 5 | + |
| 6 | +on: |
| 7 | + release: |
| 8 | + types: [published] |
| 9 | + |
| 10 | +env: |
| 11 | + CARGO_INCREMENTAL: 0 |
| 12 | + CARGO_NET_GIT_FETCH_WITH_CLI: true |
| 13 | + CARGO_NET_RETRY: 10 |
| 14 | + CARGO_TERM_COLOR: always |
| 15 | + RUST_BACKTRACE: 1 |
| 16 | + RUSTFLAGS: -D warnings |
| 17 | + RUSTUP_MAX_RETRIES: 10 |
| 18 | + |
| 19 | +defaults: |
| 20 | + run: |
| 21 | + shell: bash |
| 22 | + |
| 23 | +jobs: |
| 24 | + upload-assets: |
| 25 | + name: ${{ matrix.target }} |
| 26 | + if: github.repository_owner == 'abusch' && startsWith(github.event.release.name, 'sinuous-v') |
| 27 | + runs-on: ${{ matrix.os }} |
| 28 | + strategy: |
| 29 | + matrix: |
| 30 | + include: |
| 31 | + - target: aarch64-unknown-linux-gnu |
| 32 | + os: ubuntu-24.04 |
| 33 | + - target: aarch64-unknown-linux-musl |
| 34 | + os: ubuntu-24.04 |
| 35 | + - target: aarch64-apple-darwin |
| 36 | + os: macos-13 |
| 37 | + - target: aarch64-pc-windows-msvc |
| 38 | + os: windows-2022 |
| 39 | + - target: x86_64-unknown-linux-gnu |
| 40 | + os: ubuntu-24.04 |
| 41 | + - target: x86_64-unknown-linux-musl |
| 42 | + os: ubuntu-24.04 |
| 43 | + - target: x86_64-apple-darwin |
| 44 | + os: macos-13 |
| 45 | + - target: x86_64-pc-windows-msvc |
| 46 | + os: windows-2022 |
| 47 | + - target: x86_64-unknown-freebsd |
| 48 | + os: ubuntu-24.04 |
| 49 | + timeout-minutes: 60 |
| 50 | + steps: |
| 51 | + - name: Checkout repository |
| 52 | + uses: actions/checkout@v4 |
| 53 | + - name: Install Rust toolchain |
| 54 | + uses: dtolnay/rust-toolchain@stable |
| 55 | + - uses: taiki-e/setup-cross-toolchain-action@v1 |
| 56 | + with: |
| 57 | + target: ${{ matrix.target }} |
| 58 | + if: startsWith(matrix.os, 'ubuntu') && !contains(matrix.target, '-musl') |
| 59 | + - uses: taiki-e/install-action@v2 |
| 60 | + with: |
| 61 | + tool: cross |
| 62 | + if: contains(matrix.target, '-musl') |
| 63 | + - run: echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >> "${GITHUB_ENV}" |
| 64 | + if: endsWith(matrix.target, 'windows-msvc') |
| 65 | + - uses: taiki-e/upload-rust-binary-action@v1 |
| 66 | + with: |
| 67 | + bin: sinuous |
| 68 | + target: ${{ matrix.target }} |
| 69 | + tar: all |
| 70 | + zip: windows |
| 71 | + token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments