From 991b78a1e6587b4b1d8bcea2d7380d3197d95f78 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Mon, 16 Mar 2026 16:09:25 +1100 Subject: [PATCH] ci updates --- .github/workflows/ci-rust.yml | 72 --- .github/workflows/ci-website.yml | 37 -- .../workflows/{release-build.yml => ci.yml} | 317 ++++++----- .github/workflows/claude.yaml | 36 ++ .github/workflows/deploy-action.yml | 57 -- .github/workflows/prod-web-deploy.yml | 58 ++ .github/workflows/release.yml | 516 +++++++++--------- .github/workflows/test-web-deploy.yml | 32 ++ action/README.md | 0 action/action.yml | 0 ci-scripts/build-local.sh | 11 +- ci-scripts/get-contributors.sh | 2 +- src/app.rs | 4 +- src/commands/info.rs | 2 +- website/docs/cli-reference/info.md | 29 +- 15 files changed, 593 insertions(+), 580 deletions(-) delete mode 100644 .github/workflows/ci-rust.yml delete mode 100644 .github/workflows/ci-website.yml rename .github/workflows/{release-build.yml => ci.yml} (56%) create mode 100644 .github/workflows/claude.yaml delete mode 100644 .github/workflows/deploy-action.yml create mode 100644 .github/workflows/prod-web-deploy.yml create mode 100644 .github/workflows/test-web-deploy.yml delete mode 100644 action/README.md delete mode 100644 action/action.yml diff --git a/.github/workflows/ci-rust.yml b/.github/workflows/ci-rust.yml deleted file mode 100644 index 32a70f3..0000000 --- a/.github/workflows/ci-rust.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Rust CI - -on: - push: - branches-ignore: [main] - paths: - - 'src/**' - - 'build.rs' - - 'Cargo.toml' - - 'Cargo.lock' - - '.github/workflows/ci-rust.yml' - pull_request: - branches: [main] - paths: - - 'src/**' - - 'build.rs' - - 'Cargo.toml' - - 'Cargo.lock' - - '.github/workflows/ci-rust.yml' - -env: - CARGO_TERM_COLOR: always - -jobs: - fmt: - name: Formatting - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt - - - name: Check formatting - run: cargo fmt --all -- --check - - clippy: - name: Clippy - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - with: - components: clippy - - - name: Cache dependencies - uses: Swatinem/rust-cache@v2 - - - name: Run clippy - run: cargo clippy -- -D warnings - - test: - name: Tests - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - - - name: Cache dependencies - uses: Swatinem/rust-cache@v2 - - - name: Run tests - run: cargo test diff --git a/.github/workflows/ci-website.yml b/.github/workflows/ci-website.yml deleted file mode 100644 index bbb4472..0000000 --- a/.github/workflows/ci-website.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Website CI - -on: - push: - branches-ignore: [main] - paths: - - 'website/**' - - '.github/workflows/ci-website.yml' - pull_request: - branches: [main] - paths: - - 'website/**' - - '.github/workflows/ci-website.yml' - -jobs: - build: - name: Yarn Build - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Setup Node.js - uses: actions/setup-node@v6 - with: - node-version: '20' - cache: 'yarn' - cache-dependency-path: website/yarn.lock - - - name: Install dependencies - working-directory: website - run: yarn install --frozen-lockfile - - - name: Build website - working-directory: website - run: yarn build diff --git a/.github/workflows/release-build.yml b/.github/workflows/ci.yml similarity index 56% rename from .github/workflows/release-build.yml rename to .github/workflows/ci.yml index 1412aef..24d09c4 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/ci.yml @@ -1,145 +1,172 @@ -name: Release Build - -on: - push: - branches: [main] - paths: - - 'src/**' - - 'build.rs' - - 'Cargo.toml' - - 'Cargo.lock' - - '.github/workflows/release-build.yml' - -env: - CARGO_TERM_COLOR: always - -jobs: - # Fetch contributor list via StackQL and upload as a workflow artifact so all - # matrix build jobs can embed it into the binary at compile time. - prepare: - name: Prepare - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Pull github provider - id: pull-github-provider - uses: stackql/stackql-exec@v2 - with: - query: | - REGISTRY PULL github - is_command: true - - - name: Fetch contributors - id: get-contributors - uses: stackql/stackql-exec@v2 - with: - query_file_path: ci-scripts/get-contributors.iql - query_output: csv - - - name: Save contributors CSV - run: echo "${{ steps.get-contributors.outputs.stackql-query-results }}" > contributors.csv - - - name: Upload contributors artifact - uses: actions/upload-artifact@v7 - with: - name: contributors-csv - path: contributors.csv - - build: - name: Build (${{ matrix.target }}) - needs: prepare - strategy: - fail-fast: false - matrix: - include: - - target: x86_64-unknown-linux-gnu - os: ubuntu-latest - artifact-name: stackql-deploy-linux-x86_64 - archive: tar.gz - use-cross: false - - - target: aarch64-unknown-linux-gnu - os: ubuntu-latest - artifact-name: stackql-deploy-linux-arm64 - archive: tar.gz - use-cross: true - - - target: x86_64-pc-windows-msvc - os: windows-latest - artifact-name: stackql-deploy-windows-x86_64 - archive: zip - use-cross: false - - - target: aarch64-apple-darwin - os: macos-latest - artifact-name: stackql-deploy-macos-arm64 - archive: tar.gz - use-cross: false - - - target: x86_64-apple-darwin - os: macos-latest - artifact-name: stackql-deploy-macos-x86_64 - archive: tar.gz - use-cross: false - - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Download contributors CSV - uses: actions/download-artifact@v8 - with: - name: contributors-csv - - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.target }} - - - name: Cache dependencies - uses: Swatinem/rust-cache@v2 - with: - key: ${{ matrix.target }} - - - name: Install cross - if: matrix.use-cross == true - run: cargo install cross --git https://github.com/cross-rs/cross - - - name: Build (cross) - if: matrix.use-cross == true - run: cross build --release --target ${{ matrix.target }} - - - name: Build (native) - if: matrix.use-cross == false - run: cargo build --release --target ${{ matrix.target }} - - # Strip Linux and macOS binaries to reduce size. - # Cross-compiled ARM64 Linux is stripped by cross automatically. - - name: Strip binary (native Linux / macOS) - if: matrix.os != 'windows-latest' && matrix.use-cross == false - run: strip target/${{ matrix.target }}/release/stackql-deploy - - - name: Package (tar.gz) - if: matrix.archive == 'tar.gz' - run: | - tar -czf ${{ matrix.artifact-name }}.tar.gz \ - -C target/${{ matrix.target }}/release stackql-deploy - - - name: Package (zip) — Windows - if: matrix.archive == 'zip' - shell: pwsh - run: | - Compress-Archive ` - -Path target/${{ matrix.target }}/release/stackql-deploy.exe ` - -DestinationPath ${{ matrix.artifact-name }}.zip - - - name: Upload binary artifact - uses: actions/upload-artifact@v7 - with: - name: ${{ matrix.artifact-name }} - path: ${{ matrix.artifact-name }}.* - if-no-files-found: error +name: CI + +on: + push: + branches: ['**'] + paths: + - 'src/**' + - 'build.rs' + - 'Cargo.toml' + - 'Cargo.lock' + - '.github/workflows/ci.yml' + pull_request: + branches: [main] + paths: + - 'src/**' + - 'build.rs' + - 'Cargo.toml' + - 'Cargo.lock' + - '.github/workflows/ci.yml' + +env: + CARGO_TERM_COLOR: always + +jobs: + + # Runs on: push to any non-main branch, PR to main + lint: + name: Lint + if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/main') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt, clippy + - uses: Swatinem/rust-cache@v2 + - name: Run lint + run: bash ci-scripts/lint.sh + + # Runs on: push to any non-main branch, PR to main + test: + name: Tests + if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/main') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - name: Run tests + run: bash ci-scripts/test.sh + + # Runs on: PR to main only — single-platform release build to catch compile errors pre-merge + build-check: + name: Build Check + if: github.event_name == 'pull_request' + needs: [lint, test] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - name: Create placeholder contributors file + run: touch contributors.csv + - name: Build release + run: bash ci-scripts/build.sh + + # Runs on: push to main — fetch contributors for build-time injection + prepare: + name: Prepare + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Pull github provider + uses: stackql/stackql-exec@v2 + with: + query: REGISTRY PULL github + is_command: true + - name: Fetch contributors + id: get-contributors + uses: stackql/stackql-exec@v2 + with: + query_file_path: ci-scripts/get-contributors.iql + query_output: csv + - name: Save contributors CSV + run: echo "${{ steps.get-contributors.outputs.stackql-query-results }}" > contributors.csv + - name: Upload contributors artifact + uses: actions/upload-artifact@v7 + with: + name: contributors-csv + path: contributors.csv + + # Runs on: push to main — full matrix build after contributors are fetched + build: + name: Build (${{ matrix.target }}) + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + needs: prepare + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-unknown-linux-gnu + os: ubuntu-latest + artifact-name: stackql-deploy-linux-x86_64 + archive: tar.gz + use-cross: false + - target: aarch64-unknown-linux-gnu + os: ubuntu-latest + artifact-name: stackql-deploy-linux-arm64 + archive: tar.gz + use-cross: true + - target: x86_64-pc-windows-msvc + os: windows-latest + artifact-name: stackql-deploy-windows-x86_64 + archive: zip + use-cross: false + - target: aarch64-apple-darwin + os: macos-latest + artifact-name: stackql-deploy-macos-arm64 + archive: tar.gz + use-cross: false + - target: x86_64-apple-darwin + os: macos-latest + artifact-name: stackql-deploy-macos-x86_64 + archive: tar.gz + use-cross: false + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v6 + - uses: actions/download-artifact@v8 + with: + name: contributors-csv + - uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + - uses: Swatinem/rust-cache@v2 + with: + key: ${{ matrix.target }} + - name: Install cross + if: matrix.use-cross == true + run: cargo install cross --git https://github.com/cross-rs/cross + - name: Set contributors env + shell: bash + run: | + CONTRIBUTORS=$(tr '\n' ',' < contributors.csv | sed 's/,$//') + echo "CONTRIBUTORS=$CONTRIBUTORS" >> $GITHUB_ENV + - name: Build (cross) + if: matrix.use-cross == true + run: cross build --release --target ${{ matrix.target }} + - name: Build (native) + if: matrix.use-cross == false + run: cargo build --release --target ${{ matrix.target }} + - name: Strip binary (Linux / macOS native) + if: matrix.os != 'windows-latest' && matrix.use-cross == false + run: strip target/${{ matrix.target }}/release/stackql-deploy + - name: Package (tar.gz) + if: matrix.archive == 'tar.gz' + run: | + tar -czf ${{ matrix.artifact-name }}.tar.gz \ + -C target/${{ matrix.target }}/release stackql-deploy + - name: Package (zip) + if: matrix.archive == 'zip' + shell: pwsh + run: | + Compress-Archive ` + -Path target/${{ matrix.target }}/release/stackql-deploy.exe ` + -DestinationPath ${{ matrix.artifact-name }}.zip + - uses: actions/upload-artifact@v7 + with: + name: ${{ matrix.artifact-name }} + path: ${{ matrix.artifact-name }}.* + if-no-files-found: error diff --git a/.github/workflows/claude.yaml b/.github/workflows/claude.yaml new file mode 100644 index 0000000..d03e85d --- /dev/null +++ b/.github/workflows/claude.yaml @@ -0,0 +1,36 @@ +name: Claude PR Assistant + +on: + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + issues: + types: [opened, assigned] + pull_request_review: + types: [submitted] + +jobs: + claude-code-action: + if: | + (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || + (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || + (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || + (github.event_name == 'issues' && contains(github.event.issue.body, '@claude')) + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + issues: read + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + fetch-depth: 1 + + - name: Claude Code Action Official + uses: anthropics/claude-code-action@v1 + with: + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + timeout_minutes: "60" \ No newline at end of file diff --git a/.github/workflows/deploy-action.yml b/.github/workflows/deploy-action.yml deleted file mode 100644 index cd72ad8..0000000 --- a/.github/workflows/deploy-action.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Deploy GitHub Action - -on: - push: - branches: [main] - paths: - - 'action/**' - - 'action.yml' - - '.github/workflows/deploy-action.yml' - pull_request: - branches: [main] - paths: - - 'action/**' - - 'action.yml' - - '.github/workflows/deploy-action.yml' - -jobs: - deploy-action: - name: Deploy GitHub Action - runs-on: ubuntu-latest - - steps: - - name: Placeholder deployment - run: | - echo "šŸš€ Deploying Action (placeholder)" - echo "This is a placeholder step - actual implementation pending" - - # - name: Checkout repository - # uses: actions/checkout@v6 - # with: - # fetch-depth: 0 - - # - name: Validate action.yml - # run: | - # if [ -f "action.yml" ]; then - # echo "āœ… action.yml found and valid" - # else - # echo "āŒ action.yml not found or invalid" - # exit 1 - # fi - - # - name: Create tag if necessary - # if: github.event_name == 'push' && github.ref == 'refs/heads/main' - # id: tag_version - # uses: mathieudutour/github-tag-action@v6.1 - # with: - # github_token: ${{ secrets.GITHUB_TOKEN }} - # release_branches: main - # tag_prefix: v - - # - name: Create a GitHub release - # if: steps.tag_version.outputs.new_tag - # uses: ncipollo/release-action@v1 - # with: - # tag: ${{ steps.tag_version.outputs.new_tag }} - # name: Release ${{ steps.tag_version.outputs.new_tag }} - # body: ${{ steps.tag_version.outputs.changelog }} \ No newline at end of file diff --git a/.github/workflows/prod-web-deploy.yml b/.github/workflows/prod-web-deploy.yml new file mode 100644 index 0000000..fe0d1f6 --- /dev/null +++ b/.github/workflows/prod-web-deploy.yml @@ -0,0 +1,58 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - main + paths: + - 'website/**' + +jobs: + build: + name: Build Docusaurus + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v6 + with: + node-version: 20 + cache: yarn + cache-dependency-path: website/yarn.lock + + - name: Install dependencies + run: yarn install --frozen-lockfile + working-directory: website + + - name: Build website + run: yarn build + working-directory: website + + - name: Upload Build Artifact + uses: actions/upload-pages-artifact@v3 + with: + path: website/build # Ensure the path is correctly set to the Docusaurus build output + + deploy: + name: Deploy to GitHub Pages + needs: build + + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + + # Deploy to the github-pages environment + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + with: + working-directory: website/build # Ensures the correct directory is used for deployment diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7bf0603..2a4702a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,254 +1,262 @@ -name: Release - -on: - push: - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' - -env: - CARGO_TERM_COLOR: always - -jobs: - # Fetch contributor list via StackQL and upload as a workflow artifact so all - # matrix build jobs can embed it into the binary at compile time. - prepare: - name: Prepare - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Pull github provider - id: pull-github-provider - uses: stackql/stackql-exec@v2 - with: - query: | - REGISTRY PULL github - is_command: true - - - name: Fetch contributors - id: get-contributors - uses: stackql/stackql-exec@v2 - with: - query_file_path: ci-scripts/get-contributors.iql - query_output: csv - - - name: Save contributors CSV - run: echo "${{ steps.get-contributors.outputs.stackql-query-results }}" > contributors.csv - - - name: Upload contributors artifact - uses: actions/upload-artifact@v7 - with: - name: contributors-csv - path: contributors.csv - - build: - name: Build (${{ matrix.target }}) - needs: prepare - strategy: - fail-fast: false - matrix: - include: - - target: x86_64-unknown-linux-gnu - os: ubuntu-latest - artifact-name: stackql-deploy-linux-x86_64 - archive: tar.gz - use-cross: false - - - target: aarch64-unknown-linux-gnu - os: ubuntu-latest - artifact-name: stackql-deploy-linux-arm64 - archive: tar.gz - use-cross: true - - - target: x86_64-pc-windows-msvc - os: windows-latest - artifact-name: stackql-deploy-windows-x86_64 - archive: zip - use-cross: false - - - target: aarch64-apple-darwin - os: macos-latest - artifact-name: stackql-deploy-macos-arm64 - archive: tar.gz - use-cross: false - - - target: x86_64-apple-darwin - os: macos-latest - artifact-name: stackql-deploy-macos-x86_64 - archive: tar.gz - use-cross: false - - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Download contributors CSV - uses: actions/download-artifact@v8 - with: - name: contributors-csv - - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.target }} - - - name: Cache dependencies - uses: Swatinem/rust-cache@v2 - with: - key: ${{ matrix.target }} - - - name: Install cross - if: matrix.use-cross == true - run: cargo install cross --git https://github.com/cross-rs/cross - - - name: Build (cross) - if: matrix.use-cross == true - run: cross build --release --target ${{ matrix.target }} - - - name: Build (native) - if: matrix.use-cross == false - run: cargo build --release --target ${{ matrix.target }} - - # Strip Linux and macOS binaries to reduce size. - # Cross-compiled ARM64 Linux is stripped by cross automatically. - - name: Strip binary (native Linux / macOS) - if: matrix.os != 'windows-latest' && matrix.use-cross == false - run: strip target/${{ matrix.target }}/release/stackql-deploy - - - name: Package (tar.gz) - if: matrix.archive == 'tar.gz' - run: | - tar -czf ${{ matrix.artifact-name }}.tar.gz \ - -C target/${{ matrix.target }}/release stackql-deploy - - - name: Package (zip) — Windows - if: matrix.archive == 'zip' - shell: pwsh - run: | - Compress-Archive ` - -Path target/${{ matrix.target }}/release/stackql-deploy.exe ` - -DestinationPath ${{ matrix.artifact-name }}.zip - - - name: Upload binary artifact - uses: actions/upload-artifact@v7 - with: - name: ${{ matrix.artifact-name }} - path: ${{ matrix.artifact-name }}.* - if-no-files-found: error - - release: - name: Create GitHub Release - needs: build - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Download all build artifacts - uses: actions/download-artifact@v8 - with: - path: artifacts/ - # exclude the contributors CSV — only binary archives needed - pattern: stackql-deploy-* - - - name: Collect archives and generate SHA256SUMS - run: | - mkdir -p dist - find artifacts/ -type f \( -name '*.tar.gz' -o -name '*.zip' \) \ - -exec mv {} dist/ \; - cd dist - sha256sum * | tee SHA256SUMS - - - name: GH Release - uses: softprops/action-gh-release@v2.6.0 - with: - name: ${{ github.ref_name }} - tag_name: ${{ github.ref_name }} - fail_on_unmatched_files: true - files: | - dist/*.tar.gz - dist/*.zip - dist/SHA256SUMS - body: | - ## stackql-deploy ${{ github.ref_name }} - - ### What's new - - This release ships the **Rust rewrite** of `stackql-deploy` — a complete - ground-up reimplementation that replaces the original Python package. - - Key improvements over the Python version: - - - **Single self-contained binary** — no Python runtime, pip, or virtualenv required. - Drop the binary on any supported platform and run. - - **Faster startup and execution** — Rust compile-time optimisations mean commands - that previously took seconds to initialise now start instantly. - - **Smaller install footprint** — the stripped Linux x86_64 binary is under 10 MB; - no transitive Python dependencies to manage. - - **Statically linked on Linux** — works on any glibc ≄ 2.17 distro without - installing extra system libraries. - - **Native Windows and macOS ARM64 support** — pre-built for all five major targets - (see assets below). - - ### Download - - | Platform | Architecture | Asset | - |----------|--------------|-------| - | Linux | x86_64 | `stackql-deploy-linux-x86_64.tar.gz` | - | Linux | arm64 | `stackql-deploy-linux-arm64.tar.gz` | - | macOS | Apple Silicon (arm64) | `stackql-deploy-macos-arm64.tar.gz` | - | macOS | Intel (x86_64) | `stackql-deploy-macos-x86_64.tar.gz` | - | Windows | x86_64 | `stackql-deploy-windows-x86_64.zip` | - - Each archive contains a single binary named `stackql-deploy` (or - `stackql-deploy.exe` on Windows). Verify your download with `SHA256SUMS`. - - ### Migrating from the Python package - - If you are currently using the Python package on PyPI, please migrate to this - release. The Python package is now deprecated and will no longer receive updates: - https://pypi.org/project/stackql-deploy/ - - The CLI interface is fully compatible — existing `stackql_manifest.yml` files and - project layouts work without modification. - - ### Install (quick) - - **Linux / macOS:** - ```sh - curl -sSL https://github.com/stackql/stackql-deploy/releases/download/${{ github.ref_name }}/stackql-deploy-linux-x86_64.tar.gz \ - | tar -xz -C /usr/local/bin - ``` - - **Windows (PowerShell):** - ```powershell - Invoke-WebRequest -Uri https://github.com/stackql/stackql-deploy/releases/download/${{ github.ref_name }}/stackql-deploy-windows-x86_64.zip ` - -OutFile stackql-deploy.zip - Expand-Archive stackql-deploy.zip -DestinationPath $env:LOCALAPPDATA\stackql-deploy - ``` - - Or install via `cargo`: - ```sh - cargo install stackql-deploy - ``` - - publish: - name: Publish to crates.io - needs: release - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - - - name: Publish to crates.io - # --no-verify skips the redundant verification build that cargo publish - # performs by default. That build fails because build.rs writes - # contributors.csv into the package root (outside OUT_DIR) when the file - # is absent — which it always is inside the clean tarball sandbox. - # The binary has already been fully built and tested in the build job. - run: cargo publish --no-verify --token ${{ secrets.CARGO_REGISTRY_TOKEN }} +name: Release + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +env: + CARGO_TERM_COLOR: always + +jobs: + + # Fail fast if the tag version does not match the version in Cargo.toml + verify: + name: Verify version + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Check tag matches Cargo.toml version + run: | + CARGO_VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/') + TAG=${GITHUB_REF_NAME#v} + if [ "$CARGO_VERSION" != "$TAG" ]; then + echo "Tag ($TAG) does not match Cargo.toml version ($CARGO_VERSION)" + exit 1 + fi + echo "Version check passed: $CARGO_VERSION" + + # Fetch contributor list via StackQL and upload as a workflow artifact so all + # matrix build jobs can embed it into the binary at compile time + prepare: + name: Prepare + needs: verify + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Pull github provider + uses: stackql/stackql-exec@v2 + with: + query: REGISTRY PULL github + is_command: true + - name: Fetch contributors + id: get-contributors + uses: stackql/stackql-exec@v2 + with: + query_file_path: ci-scripts/get-contributors.iql + query_output: csv + - name: Save contributors CSV + run: echo "${{ steps.get-contributors.outputs.stackql-query-results }}" > contributors.csv + - name: Upload contributors artifact + uses: actions/upload-artifact@v7 + with: + name: contributors-csv + path: contributors.csv + + build: + name: Build (${{ matrix.target }}) + needs: prepare + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-unknown-linux-gnu + os: ubuntu-latest + artifact-name: stackql-deploy-linux-x86_64 + archive: tar.gz + use-cross: false + - target: aarch64-unknown-linux-gnu + os: ubuntu-latest + artifact-name: stackql-deploy-linux-arm64 + archive: tar.gz + use-cross: true + - target: x86_64-pc-windows-msvc + os: windows-latest + artifact-name: stackql-deploy-windows-x86_64 + archive: zip + use-cross: false + - target: aarch64-apple-darwin + os: macos-latest + artifact-name: stackql-deploy-macos-arm64 + archive: tar.gz + use-cross: false + - target: x86_64-apple-darwin + os: macos-latest + artifact-name: stackql-deploy-macos-x86_64 + archive: tar.gz + use-cross: false + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v6 + - uses: actions/download-artifact@v8 + with: + name: contributors-csv + - uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + - uses: Swatinem/rust-cache@v2 + with: + key: ${{ matrix.target }} + - name: Install cross + if: matrix.use-cross == true + run: cargo install cross --git https://github.com/cross-rs/cross + - name: Set contributors env + shell: bash + run: | + CONTRIBUTORS=$(tr '\n' ',' < contributors.csv | sed 's/,$//') + echo "CONTRIBUTORS=$CONTRIBUTORS" >> $GITHUB_ENV + - name: Build (cross) + if: matrix.use-cross == true + run: cross build --release --target ${{ matrix.target }} + - name: Build (native) + if: matrix.use-cross == false + run: cargo build --release --target ${{ matrix.target }} + - name: Strip binary (Linux / macOS native) + if: matrix.os != 'windows-latest' && matrix.use-cross == false + run: strip target/${{ matrix.target }}/release/stackql-deploy + - name: Package (tar.gz) + if: matrix.archive == 'tar.gz' + run: | + tar -czf ${{ matrix.artifact-name }}.tar.gz \ + -C target/${{ matrix.target }}/release stackql-deploy + - name: Package (zip) + if: matrix.archive == 'zip' + shell: pwsh + run: | + Compress-Archive ` + -Path target/${{ matrix.target }}/release/stackql-deploy.exe ` + -DestinationPath ${{ matrix.artifact-name }}.zip + - uses: actions/upload-artifact@v7 + with: + name: ${{ matrix.artifact-name }} + path: ${{ matrix.artifact-name }}.* + if-no-files-found: error + + release: + name: Create GitHub Release + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Download all build artifacts + uses: actions/download-artifact@v8 + with: + path: artifacts/ + pattern: stackql-deploy-* + - name: Collect archives and generate SHA256SUMS + run: | + mkdir -p dist + find artifacts/ -type f \( -name '*.tar.gz' -o -name '*.zip' \) \ + -exec mv {} dist/ \; + cd dist + sha256sum * | tee SHA256SUMS + - name: GH Release + uses: softprops/action-gh-release@v2.6.0 + with: + name: ${{ github.ref_name }} + tag_name: ${{ github.ref_name }} + fail_on_unmatched_files: true + files: | + dist/*.tar.gz + dist/*.zip + dist/SHA256SUMS + body: | + ## stackql-deploy ${{ github.ref_name }} + + ### What's new + + This release ships the **Rust rewrite** of `stackql-deploy` — a complete + ground-up reimplementation that replaces the original Python package. + + Key improvements over the Python version: + + - **Single self-contained binary** — no Python runtime, pip, or virtualenv required. + Drop the binary on any supported platform and run. + - **Faster startup and execution** — Rust compile-time optimisations mean commands + that previously took seconds to initialise now start instantly. + - **Smaller install footprint** — the stripped Linux x86_64 binary is under 10 MB; + no transitive Python dependencies to manage. + - **Statically linked on Linux** — works on any glibc >= 2.17 distro without + installing extra system libraries. + - **Native Windows and macOS ARM64 support** — pre-built for all five major targets + (see assets below). + + ### Download + + | Platform | Architecture | Asset | + |----------|--------------|-------| + | Linux | x86_64 | `stackql-deploy-linux-x86_64.tar.gz` | + | Linux | arm64 | `stackql-deploy-linux-arm64.tar.gz` | + | macOS | Apple Silicon (arm64) | `stackql-deploy-macos-arm64.tar.gz` | + | macOS | Intel (x86_64) | `stackql-deploy-macos-x86_64.tar.gz` | + | Windows | x86_64 | `stackql-deploy-windows-x86_64.zip` | + + Each archive contains a single binary named `stackql-deploy` (or + `stackql-deploy.exe` on Windows). Verify your download with `SHA256SUMS`. + + ### Migrating from the Python package + + If you are currently using the Python package on PyPI, please migrate to this + release. The Python package is now deprecated and will no longer receive updates: + https://pypi.org/project/stackql-deploy/ + + The CLI interface is fully compatible — existing `stackql_manifest.yml` files and + project layouts work without modification. + + ### Install (quick) + + **Linux / macOS:** + ```sh + curl -sSL https://github.com/stackql/stackql-deploy/releases/download/${{ github.ref_name }}/stackql-deploy-linux-x86_64.tar.gz \ + | tar -xz -C /usr/local/bin + ``` + + **Windows (PowerShell):** + ```powershell + Invoke-WebRequest -Uri https://github.com/stackql/stackql-deploy/releases/download/${{ github.ref_name }}/stackql-deploy-windows-x86_64.zip ` + -OutFile stackql-deploy.zip + Expand-Archive stackql-deploy.zip -DestinationPath $env:LOCALAPPDATA\stackql-deploy + ``` + + Or install via `cargo`: + ```sh + cargo install stackql-deploy + ``` + + # --no-verify skips the verification build that cargo publish runs by default. + # That build fails because build.rs writes contributors.csv into the package + # root (outside OUT_DIR) when the file is absent, which it always is inside + # the clean tarball sandbox. The binary has already been fully built and + # verified in the build job above. + publish: + name: Publish to crates.io + needs: release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@stable + - name: Publish to crates.io + run: cargo publish --no-verify --token ${{ secrets.CARGO_REGISTRY_TOKEN }} + + # Builds docs with private items visible and deploys to GitHub Pages. + # docs.rs also picks up the crate automatically from the publish step above, + # but only renders a minimal page for binary-only crates. GitHub Pages gives + # the full internal module tree. + # Published at: https://stackql.github.io/stackql-deploy/stackql_deploy/ + docs: + name: Publish Docs + needs: publish + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@stable + - name: Build docs + run: cargo doc --no-deps --document-private-items + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./target/doc diff --git a/.github/workflows/test-web-deploy.yml b/.github/workflows/test-web-deploy.yml new file mode 100644 index 0000000..a1b3bc2 --- /dev/null +++ b/.github/workflows/test-web-deploy.yml @@ -0,0 +1,32 @@ +name: Test deployment + +on: + pull_request: + branches: + - main + paths: + - 'website/**' + - '.github/workflows/ci-website.yml' + +jobs: + test-deploy: + name: Test deployment + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v6 + with: + node-version: 20 + cache: yarn + cache-dependency-path: website/yarn.lock + + - name: Install dependencies + run: yarn install --frozen-lockfile + working-directory: website + + - name: Test build website + run: yarn build + working-directory: website \ No newline at end of file diff --git a/action/README.md b/action/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/action/action.yml b/action/action.yml deleted file mode 100644 index e69de29..0000000 diff --git a/ci-scripts/build-local.sh b/ci-scripts/build-local.sh index 2cb53a4..dfb861a 100644 --- a/ci-scripts/build-local.sh +++ b/ci-scripts/build-local.sh @@ -13,6 +13,10 @@ echo "===============================================" echo " Running Full Local Build Process" echo "===============================================" +# Run each step in sequence +printf "\nCreating contributors file...\n" +./ci-scripts/get-contributors.sh + # Run each step in sequence printf "\n[STEP 1/5] Formatting code...\n" ./ci-scripts/format.sh @@ -21,13 +25,16 @@ printf "\n[STEP 2/5] Running linter...\n" ./ci-scripts/lint.sh printf "\n[STEP 3/5] Running tests...\n" -# ./ci-scripts/test.sh +./ci-scripts/test.sh printf "\n[STEP 4/5] Building binary...\n" ./ci-scripts/build.sh printf "\n[STEP 5/5] Generating documentation...\n" -# ./ci-scripts/doc.sh +./ci-scripts/doc.sh + +printf "\nGetting info...\n" +./target/release/stackql-deploy info printf "\nšŸŽ‰ Local build process completed successfully!\n" echo "Binary is available at: ./target/release/stackql-deploy" \ No newline at end of file diff --git a/ci-scripts/get-contributors.sh b/ci-scripts/get-contributors.sh index eafec0a..ab31b71 100644 --- a/ci-scripts/get-contributors.sh +++ b/ci-scripts/get-contributors.sh @@ -1 +1 @@ -./stackql exec --infile get-contributors.iql --output csv -f contributors.csv -H \ No newline at end of file +./stackql exec --infile ci-scripts/get-contributors.iql --output csv -f contributors.csv -H \ No newline at end of file diff --git a/src/app.rs b/src/app.rs index 01a9b12..61ffecd 100644 --- a/src/app.rs +++ b/src/app.rs @@ -20,8 +20,8 @@ /// Application name pub const APP_NAME: &str = "stackql-deploy"; -/// Application version -pub const APP_VERSION: &str = "0.1.0"; +/// Application version (sourced from Cargo.toml) +pub const APP_VERSION: &str = env!("CARGO_PKG_VERSION"); /// Application author pub const APP_AUTHOR: &str = "Jeffrey Aven "; diff --git a/src/commands/info.rs b/src/commands/info.rs index c40c33a..e7c6816 100644 --- a/src/commands/info.rs +++ b/src/commands/info.rs @@ -67,7 +67,7 @@ pub fn execute() { // Print information println!("{}", "stackql-deploy CLI".green().bold()); - println!(" Version: 0.1.0\n"); + println!(" Version: {}\n", crate::app::APP_VERSION); println!("{}", "StackQL Library".green().bold()); println!(" Version: {}", version_info.version); diff --git a/website/docs/cli-reference/info.md b/website/docs/cli-reference/info.md index b76dc31..3392712 100644 --- a/website/docs/cli-reference/info.md +++ b/website/docs/cli-reference/info.md @@ -46,13 +46,24 @@ stackql-deploy info outputs... ```plaintext -stackql-deploy version: 0.1.0 -stackql version : v0.6.002 -stackql binary path : /usr/local/bin/stackql -platform : Linux x86_64 - -installed providers: : -aws : v24.07.00246 -azure : v24.06.00242 -google : v24.06.00236 +ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” +│ Getting program information... │ +ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ +stackql-deploy CLI + Version: 0.1.0 + +StackQL Library + Version: v0.10.383 + SHA: 3374f33 + Platform: Linux + Binary Path: /mnt/c/LocalGitRepos/stackql/stackql-deploy-rs/stackql + +Local StackQL Servers + None + +Installed Providers + awscc v26.02.00373 + databricks_account v26.02.00371 + databricks_workspace v26.02.00371 + github v25.07.00320 ```