|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v[0-9]+.[0-9]+.[0-9]+' |
| 7 | + |
| 8 | +env: |
| 9 | + CARGO_TERM_COLOR: always |
| 10 | + |
| 11 | +jobs: |
| 12 | + # Fetch contributor list via StackQL and upload as a workflow artifact so all |
| 13 | + # matrix build jobs can embed it into the binary at compile time. |
| 14 | + prepare: |
| 15 | + name: Prepare |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - name: Checkout repository |
| 19 | + uses: actions/checkout@v6 |
| 20 | + |
| 21 | + - name: Pull github provider |
| 22 | + id: pull-github-provider |
| 23 | + uses: stackql/stackql-exec@v2.2.3 |
| 24 | + with: |
| 25 | + query: | |
| 26 | + REGISTRY PULL github |
| 27 | + is_command: true |
| 28 | + |
| 29 | + - name: Fetch contributors |
| 30 | + id: get-contributors |
| 31 | + uses: stackql/stackql-exec@v2.2.3 |
| 32 | + with: |
| 33 | + query_file_path: ci-scripts/get-contributors.iql |
| 34 | + query_output: csv |
| 35 | + |
| 36 | + - name: Save contributors CSV |
| 37 | + run: echo "${{ steps.get-contributors.outputs.stackql-query-results }}" > contributors.csv |
| 38 | + |
| 39 | + - name: Upload contributors artifact |
| 40 | + uses: actions/upload-artifact@v7 |
| 41 | + with: |
| 42 | + name: contributors-csv |
| 43 | + path: contributors.csv |
| 44 | + |
| 45 | + build: |
| 46 | + name: Build (${{ matrix.target }}) |
| 47 | + needs: prepare |
| 48 | + strategy: |
| 49 | + fail-fast: false |
| 50 | + matrix: |
| 51 | + include: |
| 52 | + - target: x86_64-unknown-linux-gnu |
| 53 | + os: ubuntu-latest |
| 54 | + artifact-name: stackql-deploy-linux-x86_64 |
| 55 | + archive: tar.gz |
| 56 | + use-cross: false |
| 57 | + |
| 58 | + - target: aarch64-unknown-linux-gnu |
| 59 | + os: ubuntu-latest |
| 60 | + artifact-name: stackql-deploy-linux-arm64 |
| 61 | + archive: tar.gz |
| 62 | + use-cross: true |
| 63 | + |
| 64 | + - target: x86_64-pc-windows-msvc |
| 65 | + os: windows-latest |
| 66 | + artifact-name: stackql-deploy-windows-x86_64 |
| 67 | + archive: zip |
| 68 | + use-cross: false |
| 69 | + |
| 70 | + - target: aarch64-apple-darwin |
| 71 | + os: macos-latest |
| 72 | + artifact-name: stackql-deploy-macos-arm64 |
| 73 | + archive: tar.gz |
| 74 | + use-cross: false |
| 75 | + |
| 76 | + - target: x86_64-apple-darwin |
| 77 | + os: macos-latest |
| 78 | + artifact-name: stackql-deploy-macos-x86_64 |
| 79 | + archive: tar.gz |
| 80 | + use-cross: false |
| 81 | + |
| 82 | + runs-on: ${{ matrix.os }} |
| 83 | + |
| 84 | + steps: |
| 85 | + - name: Checkout repository |
| 86 | + uses: actions/checkout@v6 |
| 87 | + |
| 88 | + - name: Download contributors CSV |
| 89 | + uses: actions/download-artifact@v8 |
| 90 | + with: |
| 91 | + name: contributors-csv |
| 92 | + |
| 93 | + - name: Install Rust toolchain |
| 94 | + uses: dtolnay/rust-toolchain@stable |
| 95 | + with: |
| 96 | + targets: ${{ matrix.target }} |
| 97 | + |
| 98 | + - name: Cache dependencies |
| 99 | + uses: Swatinem/rust-cache@v2 |
| 100 | + with: |
| 101 | + key: ${{ matrix.target }} |
| 102 | + |
| 103 | + - name: Install cross |
| 104 | + if: matrix.use-cross == true |
| 105 | + run: cargo install cross --git https://github.com/cross-rs/cross |
| 106 | + |
| 107 | + - name: Build (cross) |
| 108 | + if: matrix.use-cross == true |
| 109 | + run: cross build --release --target ${{ matrix.target }} |
| 110 | + |
| 111 | + - name: Build (native) |
| 112 | + if: matrix.use-cross == false |
| 113 | + run: cargo build --release --target ${{ matrix.target }} |
| 114 | + |
| 115 | + # Strip Linux and macOS binaries to reduce size. |
| 116 | + # Cross-compiled ARM64 Linux is stripped by cross automatically. |
| 117 | + - name: Strip binary (native Linux / macOS) |
| 118 | + if: matrix.os != 'windows-latest' && matrix.use-cross == false |
| 119 | + run: strip target/${{ matrix.target }}/release/stackql-deploy |
| 120 | + |
| 121 | + - name: Package (tar.gz) |
| 122 | + if: matrix.archive == 'tar.gz' |
| 123 | + run: | |
| 124 | + tar -czf ${{ matrix.artifact-name }}.tar.gz \ |
| 125 | + -C target/${{ matrix.target }}/release stackql-deploy |
| 126 | +
|
| 127 | + - name: Package (zip) — Windows |
| 128 | + if: matrix.archive == 'zip' |
| 129 | + shell: pwsh |
| 130 | + run: | |
| 131 | + Compress-Archive ` |
| 132 | + -Path target/${{ matrix.target }}/release/stackql-deploy.exe ` |
| 133 | + -DestinationPath ${{ matrix.artifact-name }}.zip |
| 134 | +
|
| 135 | + - name: Upload binary artifact |
| 136 | + uses: actions/upload-artifact@v7 |
| 137 | + with: |
| 138 | + name: ${{ matrix.artifact-name }} |
| 139 | + path: ${{ matrix.artifact-name }}.* |
| 140 | + if-no-files-found: error |
| 141 | + |
| 142 | + release: |
| 143 | + name: Create GitHub Release |
| 144 | + needs: build |
| 145 | + runs-on: ubuntu-latest |
| 146 | + permissions: |
| 147 | + contents: write |
| 148 | + steps: |
| 149 | + - name: Download all build artifacts |
| 150 | + uses: actions/download-artifact@v8 |
| 151 | + with: |
| 152 | + path: artifacts/ |
| 153 | + # exclude the contributors CSV — only binary archives needed |
| 154 | + pattern: stackql-deploy-* |
| 155 | + |
| 156 | + - name: Collect archives and generate SHA256SUMS |
| 157 | + run: | |
| 158 | + mkdir -p dist |
| 159 | + find artifacts/ -type f \( -name '*.tar.gz' -o -name '*.zip' \) \ |
| 160 | + -exec mv {} dist/ \; |
| 161 | + cd dist |
| 162 | + sha256sum * | tee SHA256SUMS |
| 163 | +
|
| 164 | + - name: GH Release |
| 165 | + uses: softprops/action-gh-release@v2.6.0 |
| 166 | + with: |
| 167 | + name: ${{ github.ref_name }} |
| 168 | + tag_name: ${{ github.ref_name }} |
| 169 | + fail_on_unmatched_files: true |
| 170 | + files: | |
| 171 | + dist/*.tar.gz |
| 172 | + dist/*.zip |
| 173 | + dist/SHA256SUMS |
| 174 | + body: | |
| 175 | + ## stackql-deploy ${{ github.ref_name }} |
| 176 | +
|
| 177 | + ### What's new |
| 178 | +
|
| 179 | + This release ships the **Rust rewrite** of `stackql-deploy` — a complete |
| 180 | + ground-up reimplementation that replaces the original Python package. |
| 181 | +
|
| 182 | + Key improvements over the Python version: |
| 183 | +
|
| 184 | + - **Single self-contained binary** — no Python runtime, pip, or virtualenv required. |
| 185 | + Drop the binary on any supported platform and run. |
| 186 | + - **Faster startup and execution** — Rust compile-time optimisations mean commands |
| 187 | + that previously took seconds to initialise now start instantly. |
| 188 | + - **Smaller install footprint** — the stripped Linux x86_64 binary is under 10 MB; |
| 189 | + no transitive Python dependencies to manage. |
| 190 | + - **Statically linked on Linux** — works on any glibc ≥ 2.17 distro without |
| 191 | + installing extra system libraries. |
| 192 | + - **Native Windows and macOS ARM64 support** — pre-built for all five major targets |
| 193 | + (see assets below). |
| 194 | +
|
| 195 | + ### Download |
| 196 | +
|
| 197 | + | Platform | Architecture | Asset | |
| 198 | + |----------|--------------|-------| |
| 199 | + | Linux | x86_64 | `stackql-deploy-linux-x86_64.tar.gz` | |
| 200 | + | Linux | arm64 | `stackql-deploy-linux-arm64.tar.gz` | |
| 201 | + | macOS | Apple Silicon (arm64) | `stackql-deploy-macos-arm64.tar.gz` | |
| 202 | + | macOS | Intel (x86_64) | `stackql-deploy-macos-x86_64.tar.gz` | |
| 203 | + | Windows | x86_64 | `stackql-deploy-windows-x86_64.zip` | |
| 204 | +
|
| 205 | + Each archive contains a single binary named `stackql-deploy` (or |
| 206 | + `stackql-deploy.exe` on Windows). Verify your download with `SHA256SUMS`. |
| 207 | +
|
| 208 | + ### Migrating from the Python package |
| 209 | +
|
| 210 | + If you are currently using the Python package on PyPI, please migrate to this |
| 211 | + release. The Python package is now deprecated and will no longer receive updates: |
| 212 | + https://pypi.org/project/stackql-deploy/ |
| 213 | +
|
| 214 | + The CLI interface is fully compatible — existing `stackql_manifest.yml` files and |
| 215 | + project layouts work without modification. |
| 216 | +
|
| 217 | + ### Install (quick) |
| 218 | +
|
| 219 | + **Linux / macOS:** |
| 220 | + ```sh |
| 221 | + curl -sSL https://github.com/stackql/stackql-deploy/releases/download/${{ github.ref_name }}/stackql-deploy-linux-x86_64.tar.gz \ |
| 222 | + | tar -xz -C /usr/local/bin |
| 223 | + ``` |
| 224 | +
|
| 225 | + **Windows (PowerShell):** |
| 226 | + ```powershell |
| 227 | + Invoke-WebRequest -Uri https://github.com/stackql/stackql-deploy/releases/download/${{ github.ref_name }}/stackql-deploy-windows-x86_64.zip ` |
| 228 | + -OutFile stackql-deploy.zip |
| 229 | + Expand-Archive stackql-deploy.zip -DestinationPath $env:LOCALAPPDATA\stackql-deploy |
| 230 | + ``` |
| 231 | +
|
| 232 | + Or install via `cargo`: |
| 233 | + ```sh |
| 234 | + cargo install stackql-deploy |
| 235 | + ``` |
| 236 | +
|
| 237 | + publish: |
| 238 | + name: Publish to crates.io |
| 239 | + needs: release |
| 240 | + runs-on: ubuntu-latest |
| 241 | + steps: |
| 242 | + - name: Checkout repository |
| 243 | + uses: actions/checkout@v6 |
| 244 | + |
| 245 | + - name: Install Rust toolchain |
| 246 | + uses: dtolnay/rust-toolchain@stable |
| 247 | + |
| 248 | + - name: Publish to crates.io |
| 249 | + run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }} |
0 commit comments