|
1 |
| -name: Build |
2 |
| -on: |
3 |
| - pull_request: |
4 |
| - branches: [master] |
5 |
| - push: |
6 |
| - branches: |
7 |
| - - master |
| 1 | +name: CD Pipeline |
| 2 | + |
| 3 | +on: [push] |
| 4 | + |
8 | 5 | jobs:
|
9 |
| - test: |
10 |
| - name: Test Suite |
| 6 | + build-nix: |
| 7 | + env: |
| 8 | + IN_PIPELINE: true |
| 9 | + runs-on: ${{ matrix.os }} |
| 10 | + if: github.ref == 'refs/heads/master' |
11 | 11 | strategy:
|
12 | 12 | matrix:
|
13 |
| - os: [ubuntu-latest, macos-latest, windows-latest] |
14 |
| - rust: [stable] |
15 |
| - runs-on: ${{ matrix.os }} |
| 13 | + type: [ubuntu-x64, ubuntu-x86, armv7, aarch64] |
| 14 | + include: |
| 15 | + - type: ubuntu-x64 |
| 16 | + os: ubuntu-latest |
| 17 | + target: x86_64-unknown-linux-musl |
| 18 | + name: x86_64-linux-rustscan |
| 19 | + path: target/x86_64-unknown-linux-musl/release/rustscan |
| 20 | + pkg_config_path: /usr/lib/x86_64-linux-gnu/pkgconfig |
| 21 | + - type: ubuntu-x86 |
| 22 | + os: ubuntu-latest |
| 23 | + target: i686-unknown-linux-musl |
| 24 | + name: x86-linux-rustscan |
| 25 | + path: target/i686-unknown-linux-musl/release/rustscan |
| 26 | + pkg_config_path: /usr/lib/i686-linux-gnu/pkgconfig |
| 27 | + - type: armv7 |
| 28 | + os: ubuntu-latest |
| 29 | + target: armv7-unknown-linux-gnueabihf |
| 30 | + name: armv7-linux-rustscan |
| 31 | + path: target/armv7-unknown-linux-gnueabihf/release/rustscan |
| 32 | + pkg_config_path: /usr/lib/x86_64-linux-gnu/pkgconfig |
| 33 | + - type: aarch64 |
| 34 | + os: ubuntu-latest |
| 35 | + target: aarch64-unknown-linux-gnu |
| 36 | + name: aarch64-linux-rustscan |
| 37 | + path: target/aarch64-unknown-linux-gnu/release/rustscan |
| 38 | + pkg_config_path: /usr/lib/x86_64-linux-gnu/pkgconfig |
16 | 39 | steps:
|
17 |
| - - name: Checkout sources |
18 |
| - uses: actions/checkout@v4 |
19 |
| - |
20 |
| - - name: Install stable toolchain |
21 |
| - uses: actions-rs/toolchain@v1 |
| 40 | + - uses: actions/checkout@v4 |
| 41 | + - name: Cache cargo & target directories |
| 42 | + uses: Swatinem/rust-cache@v2 |
| 43 | + - name: Build binary |
| 44 | + uses: houseabsolute/actions-rust-cross@v0 |
22 | 45 | with:
|
23 |
| - profile: minimal |
24 |
| - toolchain: ${{ matrix.rust }} |
25 |
| - override: true |
26 |
| - |
27 |
| - - uses: taiki-e/install-action@nextest |
28 |
| - - uses: Swatinem/rust-cache@v2 |
| 46 | + command: build |
| 47 | + target: ${{ matrix.target }} |
| 48 | + args: "--locked --release" |
| 49 | + strip: true |
| 50 | + toolchain: stable |
| 51 | + - name: Build tar.gz for homebrew installs |
| 52 | + if: matrix.type == 'ubuntu-x64' |
| 53 | + run: | |
| 54 | + tar czf ${{ matrix.name }}.tar.gz -C target/x86_64-unknown-linux-musl/release rustscan |
| 55 | + - uses: actions/upload-artifact@v4 |
| 56 | + with: |
| 57 | + name: ${{ matrix.name }} |
| 58 | + path: ${{ matrix.path }} |
| 59 | + - uses: actions/upload-artifact@v4 |
| 60 | + if: matrix.type == 'ubuntu-x64' |
| 61 | + with: |
| 62 | + name: ${{ matrix.name }}.tar.gz |
| 63 | + path: ${{ matrix.name }}.tar.gz |
| 64 | + build-deb: |
| 65 | + needs: [build-nix] |
| 66 | + runs-on: ubuntu-latest |
| 67 | + env: |
| 68 | + IN_PIPELINE: true |
| 69 | + steps: |
| 70 | + - uses: actions/checkout@v4 |
| 71 | + - name: Install cargo-deb |
| 72 | + run: cargo install -f cargo-deb |
| 73 | + - uses: awalsh128/cache-apt-pkgs-action@v1 |
| 74 | + with: |
| 75 | + packages: musl-tools # provides musl-gcc |
| 76 | + version: 1.0 |
| 77 | + - name: Install musl toolchain |
| 78 | + run: rustup target add x86_64-unknown-linux-musl |
| 79 | + - name: Deb Build |
| 80 | + run: cargo deb --target=x86_64-unknown-linux-musl |
| 81 | + - name: Upload Deb Artifact |
| 82 | + uses: actions/upload-artifact@v4 |
| 83 | + with: |
| 84 | + name: rustscan.deb |
| 85 | + path: ./target/x86_64-unknown-linux-musl/debian/* |
29 | 86 |
|
30 |
| - - name: Install Just |
31 |
| - uses: extractions/setup-just@v2 |
| 87 | + build-macos: |
| 88 | + env: |
| 89 | + IN_PIPELINE: true |
| 90 | + runs-on: macos-latest |
| 91 | + if: github.ref == 'refs/heads/master' |
| 92 | + steps: |
| 93 | + - uses: actions/checkout@v4 |
| 94 | + - name: Cache cargo & target directories |
| 95 | + uses: Swatinem/rust-cache@v2 |
| 96 | + - name: Build binary |
| 97 | + uses: houseabsolute/actions-rust-cross@v0 |
| 98 | + with: |
| 99 | + command: build |
| 100 | + target: x86_64-apple-darwin |
| 101 | + args: "--locked --release" |
| 102 | + strip: true |
| 103 | + toolchain: stable |
| 104 | + - name: Build tar.gz for homebrew installs |
| 105 | + run: | |
| 106 | + tar czf x86_64-macos-rustscan.tar.gz -C target/x86_64-apple-darwin/release rustscan |
| 107 | + - uses: actions/upload-artifact@v4 |
| 108 | + with: |
| 109 | + name: x86_64-macos-rustscan |
| 110 | + path: target/x86_64-apple-darwin/release/rustscan |
| 111 | + - uses: actions/upload-artifact@v4 |
| 112 | + with: |
| 113 | + name: x86_64-macos-rustscan.tar.gz |
| 114 | + path: x86_64-macos-rustscan.tar.gz |
| 115 | + |
| 116 | + build-macos-aarch64: |
| 117 | + env: |
| 118 | + IN_PIPELINE: true |
| 119 | + runs-on: macos-latest |
| 120 | + if: github.ref == 'refs/heads/master' |
| 121 | + steps: |
| 122 | + - uses: actions/checkout@v4 |
| 123 | + - name: Cache cargo & target directories |
| 124 | + uses: Swatinem/rust-cache@v2 |
| 125 | + - name: Build binary |
| 126 | + uses: houseabsolute/actions-rust-cross@v0 |
| 127 | + with: |
| 128 | + command: build |
| 129 | + target: aarch64-apple-darwin |
| 130 | + args: "--locked --release" |
| 131 | + strip: true |
| 132 | + toolchain: stable |
| 133 | + - name: Build tar.gz for homebrew installs |
| 134 | + run: | |
| 135 | + tar czf aarch64-macos-rustscan.tar.gz -C target/aarch64-apple-darwin/release rustscan |
| 136 | + - uses: actions/upload-artifact@v4 |
| 137 | + with: |
| 138 | + name: aarch64-macos-rustscan |
| 139 | + path: target/aarch64-apple-darwin/release/rustscan |
| 140 | + - uses: actions/upload-artifact@v4 |
| 141 | + with: |
| 142 | + name: aarch64-macos-rustscan.tar.gz |
| 143 | + path: aarch64-macos-rustscan.tar.gz |
32 | 144 |
|
33 |
| - - name: Run just |
34 |
| - run: just test |
| 145 | + build-windows: |
| 146 | + env: |
| 147 | + IN_PIPELINE: true |
| 148 | + runs-on: ${{ matrix.os }} |
| 149 | + if: github.ref == 'refs/heads/master' |
| 150 | + strategy: |
| 151 | + matrix: |
| 152 | + type: [windows-x64, windows-x86] |
| 153 | + include: |
| 154 | + - type: windows-x64 |
| 155 | + os: windows-latest |
| 156 | + target: x86_64-pc-windows-msvc |
| 157 | + name: x86_64-windows-rustscan.exe |
| 158 | + path: target\x86_64-pc-windows-msvc\release\rustscan.exe |
| 159 | + - type: windows-x86 |
| 160 | + os: windows-latest |
| 161 | + target: i686-pc-windows-msvc |
| 162 | + name: x86-windows-rustscan.exe |
| 163 | + path: target\i686-pc-windows-msvc\release\rustscan.exe |
| 164 | + steps: |
| 165 | + - uses: actions/checkout@v4 |
| 166 | + - name: Cache cargo & target directories |
| 167 | + uses: Swatinem/rust-cache@v2 |
| 168 | + - name: Build binary |
| 169 | + uses: houseabsolute/actions-rust-cross@v0 |
| 170 | + with: |
| 171 | + command: build |
| 172 | + target: ${{ matrix.target }} |
| 173 | + args: "--locked --release" |
| 174 | + strip: true |
| 175 | + toolchain: stable |
| 176 | + - uses: actions/upload-artifact@v4 |
| 177 | + with: |
| 178 | + name: ${{ matrix.name }} |
| 179 | + path: ${{ matrix.path }} |
0 commit comments