From a9c5dab28d251918942bc289c05b3ef927579304 Mon Sep 17 00:00:00 2001 From: Konstantin Mikhailov Date: Sun, 27 Sep 2026 09:57:35 +0300 Subject: [PATCH 1/2] Refresh APT indexes before installing release build dependencies --- .github/workflows/rust.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 09020f6..cd61ef2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -33,8 +33,10 @@ jobs: steps: - uses: actions/checkout@v6 - - name: Install PCAP lib (only on Linux) - run: sudo apt-get install -y libpcap-dev + - name: Install libpcap development headers + run: | + sudo apt-get update + sudo apt-get install -y libpcap-dev - name: Set up Rust 1.98.1 uses: dtolnay/rust-toolchain@1.98.1 From f99fff1df5413b3055a5d98959c18a7406c0f2f0 Mon Sep 17 00:00:00 2001 From: Konstantin Mikhailov Date: Sun, 27 Sep 2026 10:03:27 +0300 Subject: [PATCH 2/2] Allow rebuilding one platform from an existing release tag --- .github/workflows/rust.yml | 54 +++++++++++++++++++++++++++----------- CONTRIBUTING.md | 13 +++++++++ 2 files changed, 52 insertions(+), 15 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index cd61ef2..fcf3252 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -4,6 +4,21 @@ on: push: tags: - 'v*.*.*' + workflow_dispatch: + inputs: + tag: + description: Existing release tag to rebuild (for example v0.4.0) + required: true + type: string + runner: + description: Release platform to rebuild + required: true + type: choice + default: ubuntu-22.04 + options: + - ubuntu-22.04 + - ubuntu-24.04 + - ubuntu-24.04-arm permissions: contents: write @@ -13,25 +28,31 @@ env: jobs: build-ubuntu: - name: Build on ${{ matrix.os_label }} + name: Build on ${{ matrix.runner }} runs-on: ${{ matrix.runner }} + env: + RELEASE_TAG: ${{ inputs.tag || github.ref_name }} + ARTIFACT_SUFFIX: ${{ fromJSON('{"ubuntu-22.04":"ubuntu_22.04_x86_64","ubuntu-24.04":"ubuntu_24.04_x86_64","ubuntu-24.04-arm":"ubuntu_24.04_arm64"}')[matrix.runner] }} strategy: fail-fast: false matrix: - include: - - runner: ubuntu-22.04 - os_label: Ubuntu 22.04 x86_64 - artifact_suffix: ubuntu_22.04_x86_64 - - runner: ubuntu-24.04 - os_label: Ubuntu 24.04 x86_64 - artifact_suffix: ubuntu_24.04_x86_64 - - runner: ubuntu-24.04-arm - os_label: Ubuntu 24.04 arm64 - rust_target: aarch64-unknown-linux-gnu - artifact_suffix: ubuntu_24.04_arm64 + runner: ${{ fromJSON(github.event_name == 'workflow_dispatch' && format('["{0}"]', inputs.runner) || '["ubuntu-22.04","ubuntu-24.04","ubuntu-24.04-arm"]') }} steps: + - name: Validate release tag + shell: bash + run: | + if [[ ! "$RELEASE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$ ]]; then + echo "Expected a release tag such as v0.4.0" >&2 + exit 1 + fi + - uses: actions/checkout@v6 + with: + ref: refs/tags/${{ env.RELEASE_TAG }} + + - name: Show source revision + run: git rev-parse HEAD - name: Install libpcap development headers run: | @@ -47,15 +68,18 @@ jobs: echo "PACKAGE_VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2 | sed 's/\./_/g')" >> $GITHUB_ENV - name: Build release binary - run: cargo build --release --verbose + run: cargo build --release --locked --verbose - name: Create tar.bz2 archive run: | - tar -cjf dpp_${PACKAGE_VERSION}_${{ matrix.artifact_suffix }}.tar.bz2 -C target/release dpp + tar -cjf "dpp_${PACKAGE_VERSION}_${ARTIFACT_SUFFIX}.tar.bz2" -C target/release dpp - name: Upload Linux binary to GitHub Releases uses: softprops/action-gh-release@v2 with: - files: "dpp_${{ env.PACKAGE_VERSION }}_${{ matrix.artifact_suffix }}.tar.bz2" + tag_name: ${{ env.RELEASE_TAG }} + files: "dpp_${{ env.PACKAGE_VERSION }}_${{ env.ARTIFACT_SUFFIX }}.tar.bz2" + fail_on_unmatched_files: true + overwrite_files: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b57974c..79c2013 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,6 +43,19 @@ Examples: - Writer changes should verify output compatibility and shutdown behavior. - Benchmark harness changes should be validated with `bash -n benches/benchmark.sh` and a dry run. +## Rebuilding a Missing Release Asset + +Once the corrected release workflow is on `main`, rebuild one platform from an existing tag: + +```bash +gh workflow run rust.yml --ref main -f tag=v0.4.0 -f runner=ubuntu-22.04 +``` + +This runs the current workflow but checks out the source from `refs/tags/v0.4.0`. It does not +move the tag or overwrite existing release assets. The other runner choices are `ubuntu-24.04` +and `ubuntu-24.04-arm`. Tag pushes still build all three platforms. Re-running an older failed +run uses its original workflow revision, so it does not pick up a workflow fix committed later. + ## Community and Commercial Scope DPP Community Edition and DPP Commercial Edition intentionally have different scopes.