This is an automated email from the ASF dual-hosted git repository. hgruszecki pushed a commit to branch prerelease-binaries in repository https://gitbox.apache.org/repos/asf/iggy.git
commit 08e11a9e7711509c4d4550e1f32a1ac6574f1845 Author: Hubert Gruszecki <[email protected]> AuthorDate: Fri Dec 5 15:07:07 2025 +0100 feat(ci): add Linux edge binary builds with rolling GitHub pre-release Add reusable _build_rust_binaries.yml workflow for x86_64 GNU/musl. Post-merge now builds iggy-server, iggy, iggy-bench tarballs. Creates/updates 'edge' pre-release tag on every master push. --- .github/workflows/_build_rust_binaries.yml | 212 +++++++++++++++++++++++++++++ .github/workflows/dependabot-licenses.yml | 65 --------- .github/workflows/post-merge.yml | 63 ++++++++- 3 files changed, 273 insertions(+), 67 deletions(-) diff --git a/.github/workflows/_build_rust_binaries.yml b/.github/workflows/_build_rust_binaries.yml new file mode 100644 index 000000000..913ac3ea7 --- /dev/null +++ b/.github/workflows/_build_rust_binaries.yml @@ -0,0 +1,212 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# .github/workflows/_build_rust_binaries.yml +name: _build_rust_binaries +on: + workflow_call: + inputs: + version: + type: string + required: false + default: "edge" + description: "Version string for artifact naming (e.g., 'edge', '0.6.253')" + upload_artifacts: + type: boolean + required: false + default: true + use_latest_ci: + type: boolean + required: false + default: false + description: "Use latest CI configuration and scripts from master branch" + commit: + type: string + required: false + default: "" + description: "Specific commit to checkout for building binaries" + binaries: + type: string + required: false + default: "iggy-server,iggy,iggy-bench" + description: "Comma-separated list of binaries to build" + outputs: + artifact_name: + description: "Name of the uploaded artifact containing all binaries" + value: ${{ jobs.collect.outputs.artifact_name }} + +env: + IGGY_CI_BUILD: true + +jobs: + linux: + name: Linux ${{ matrix.target }} + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-unknown-linux-gnu + runner: ubuntu-latest + libc: gnu + - target: x86_64-unknown-linux-musl + runner: ubuntu-latest + libc: musl + steps: + - name: Download latest copy script from master + if: inputs.use_latest_ci + run: | + curl -sSL "https://raw.githubusercontent.com/${{ github.repository }}/master/scripts/copy-latest-from-master.sh" \ + -o /tmp/copy-latest-from-master.sh + chmod +x /tmp/copy-latest-from-master.sh + + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.commit || github.sha }} + + - name: Save and apply latest CI from master + if: inputs.use_latest_ci + run: | + /tmp/copy-latest-from-master.sh save .github scripts + /tmp/copy-latest-from-master.sh apply + + - name: Install musl-tools + if: matrix.libc == 'musl' + run: sudo apt-get update && sudo apt-get install -y musl-tools + + - name: Setup Rust with cache + uses: ./.github/actions/utils/setup-rust-with-cache + with: + cache-targets: false + + - name: Add Rust target + run: rustup target add ${{ matrix.target }} + + - name: Build binaries + shell: bash + run: | + set -euo pipefail + + binaries="${{ inputs.binaries }}" + bin_flags=() + + IFS=',' read -ra bins <<< "$binaries" + for bin in "${bins[@]}"; do + name="$(echo "$bin" | xargs)" + [[ -z "$name" ]] && continue + bin_flags+=(--bin "$name") + done + + cargo build --release --target ${{ matrix.target }} "${bin_flags[@]}" + + - name: Package binaries + id: pkg + shell: bash + run: | + set -euo pipefail + + target="${{ matrix.target }}" + version="${{ inputs.version }}" + outdir="dist/${target}" + mkdir -p "${outdir}" + + binaries="${{ inputs.binaries }}" + IFS=',' read -ra bins <<< "$binaries" + for bin in "${bins[@]}"; do + bin_name="$(echo "$bin" | xargs)" + [[ -z "$bin_name" ]] && continue + cp "target/${target}/release/${bin_name}" "${outdir}/" + done + + tarball="iggy-${target}-${version}.tar.gz" + tar czf "${tarball}" -C "${outdir}" . + + echo "tarball=${tarball}" >> "$GITHUB_OUTPUT" + echo "Built: ${tarball}" + ls -lh "${tarball}" + + - name: Upload artifact + if: inputs.upload_artifacts + uses: actions/upload-artifact@v4 + with: + name: rust-binaries-${{ matrix.target }} + path: ${{ steps.pkg.outputs.tarball }} + retention-days: 7 + if-no-files-found: error + + collect: + name: Collect all binaries + needs: [linux] + if: inputs.upload_artifacts + runs-on: ubuntu-latest + outputs: + artifact_name: ${{ steps.output.outputs.artifact_name }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.commit || github.sha }} + + - name: Get server version + id: meta + run: | + chmod +x scripts/extract-version.sh + server_version=$(scripts/extract-version.sh rust-server) + echo "server_version=${server_version}" >> "$GITHUB_OUTPUT" + + - name: Download all binaries + uses: actions/download-artifact@v4 + with: + pattern: rust-binaries-* + merge-multiple: true + path: dist + + - name: List binaries + run: | + echo "## 📦 Built Rust Binaries" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "| Target | Libc | File | Size |" >> $GITHUB_STEP_SUMMARY + echo "|--------|------|------|------|" >> $GITHUB_STEP_SUMMARY + + for tarball in dist/*.tar.gz; do + filename=$(basename "$tarball") + size=$(ls -lh "$tarball" | awk '{print $5}') + + if [[ "$filename" == *"gnu"* ]]; then libc="glibc" + elif [[ "$filename" == *"musl"* ]]; then libc="musl (static)" + else libc="unknown"; fi + + if [[ "$filename" == *"x86_64"* ]]; then target="x86_64" + elif [[ "$filename" == *"aarch64"* ]]; then target="aarch64" + else target="unknown"; fi + + echo "| $target | $libc | \`$filename\` | $size |" >> $GITHUB_STEP_SUMMARY + done + + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Server version:** ${{ steps.meta.outputs.server_version }}" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Binaries included:** ${{ inputs.binaries }}" >> $GITHUB_STEP_SUMMARY + + - name: Upload combined artifact + uses: actions/upload-artifact@v4 + with: + name: rust-binaries-all + path: dist + retention-days: 30 + + - id: output + run: echo "artifact_name=rust-binaries-all" >> $GITHUB_OUTPUT diff --git a/.github/workflows/dependabot-licenses.yml b/.github/workflows/dependabot-licenses.yml deleted file mode 100644 index 8b433feb4..000000000 --- a/.github/workflows/dependabot-licenses.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -name: Update licenses for Dependabot PRs - -on: - pull_request_target: - paths: - - "Cargo.toml" - - "Cargo.lock" - - "**/Cargo.toml" - -permissions: - contents: write - pull-requests: write - -jobs: - update-licenses: - name: Update DEPENDENCIES.md - runs-on: ubuntu-latest - if: github.actor == 'dependabot[bot]' - steps: - - name: Checkout PR branch - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.ref }} - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Setup Rust with cache - uses: ./.github/actions/utils/setup-rust-with-cache - with: - cache-targets: false # Only cache registry and git deps, not target dir (sccache handles that) - show-stats: true - - - name: Install cargo-license - run: cargo install cargo-license - - - name: Update DEPENDENCIES.md - run: ./scripts/ci/licenses-list.sh --update - - - name: Commit changes - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git add DEPENDENCIES.md - if git diff --staged --quiet; then - echo "No changes to commit" - else - git commit -m "chore(deps): update DEPENDENCIES.md" - git push - fi diff --git a/.github/workflows/post-merge.yml b/.github/workflows/post-merge.yml index 9b383edf6..3480d71af 100644 --- a/.github/workflows/post-merge.yml +++ b/.github/workflows/post-merge.yml @@ -83,7 +83,7 @@ jobs: matrix: ${{ fromJson(needs.plan.outputs.matrix) }} env: DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} steps: - uses: actions/checkout@v4 @@ -93,4 +93,63 @@ jobs: libc: musl component: ${{ matrix.component }} version: edge - dry_run: ${{ github.event.repository.fork }} # forks: always dry-run + dry_run: ${{ github.event.repository.fork }} # forks: always dry-run + + build-rust-binaries: + name: Build Rust binaries + uses: ./.github/workflows/_build_rust_binaries.yml + with: + version: edge + upload_artifacts: true + + create-prerelease: + name: Create edge pre-release + runs-on: ubuntu-latest + needs: build-rust-binaries + if: needs.build-rust-binaries.result == 'success' + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - name: Get server version + id: meta + run: | + chmod +x scripts/extract-version.sh + server_version=$(scripts/extract-version.sh rust-server) + echo "server_version=${server_version}" >> "$GITHUB_OUTPUT" + + - name: Download edge artifacts + uses: actions/download-artifact@v4 + with: + name: rust-binaries-all + path: ./artifacts + + - name: Create/update edge pre-release + uses: softprops/action-gh-release@v2 + with: + tag_name: edge + name: Edge (latest) + draft: false + prerelease: true + make_latest: false + files: artifacts/**/*.tar.gz + body: | + Rolling edge build of Apache Iggy binaries. + + **This release is automatically updated on every push to master.** + + ## Binaries included + - `iggy-server` - The streaming server + - `iggy` - Command-line interface + - `iggy-bench` - Benchmarking tool + + ## Downloads + - `iggy-x86_64-unknown-linux-gnu-edge.tar.gz` - Linux (glibc) + - `iggy-x86_64-unknown-linux-musl-edge.tar.gz` - Linux (musl, static) + + ## Build info + - Server version: ${{ steps.meta.outputs.server_version }} + - Commit: ${{ github.sha }} + + ⚠️ **Not an official ASF release** - for development/testing only.
