Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 43 additions & 17 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -13,28 +28,36 @@ 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: Install PCAP lib (only on Linux)
run: sudo apt-get install -y libpcap-dev
- name: Show source revision
run: git rev-parse HEAD

- 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
Expand All @@ -45,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 }}
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading