Skip to content

Commit 0980e37

Browse files
authored
ci(ppa): add Ubuntu 26.04 (Resolute) PPA build (#254) (#256)
* ci(ppa): add Ubuntu 26.04 (Resolute) PPA build (#254) * ci(ppa): pin rustc/cargo per release (resolute=1.91)
1 parent 055c05e commit 0980e37

4 files changed

Lines changed: 86 additions & 32 deletions

File tree

.github/workflows/ppa-release.yml

Lines changed: 63 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ on:
1313
ubuntu_release:
1414
description: 'Ubuntu release codename'
1515
required: true
16-
default: 'oracular'
16+
default: 'resolute'
1717
type: choice
1818
options:
19-
- questing # 25.04
20-
- oracular # 24.10 with Rust 1.81
21-
- noble # 24.04 LTS with Rust 1.82
19+
- questing # 25.10
20+
- resolute # 26.04 LTS
2221
tarball_suffix:
2322
description: 'Tarball suffix (e.g., ds1, ds2) - leave empty for new releases'
2423
required: false
@@ -34,12 +33,28 @@ env:
3433
PPA: ppa:domcyrus/rustnet
3534

3635
jobs:
36+
set-matrix:
37+
runs-on: ubuntu-24.04
38+
outputs:
39+
releases: ${{ steps.set.outputs.releases }}
40+
steps:
41+
- id: set
42+
run: |
43+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
44+
echo 'releases=["${{ inputs.ubuntu_release }}"]' >> $GITHUB_OUTPUT
45+
echo "Dispatch: building only ${{ inputs.ubuntu_release }}"
46+
else
47+
echo 'releases=["questing","resolute"]' >> $GITHUB_OUTPUT
48+
echo "Auto: building questing and resolute"
49+
fi
50+
3751
build-and-upload:
52+
needs: set-matrix
3853
runs-on: ubuntu-24.04
3954
strategy:
55+
fail-fast: false
4056
matrix:
41-
ubuntu_release:
42-
- questing
57+
ubuntu_release: ${{ fromJSON(needs.set-matrix.outputs.releases) }}
4358

4459
steps:
4560
- name: Checkout code
@@ -91,28 +106,40 @@ jobs:
91106
echo "Using version: $VERSION"
92107
fi
93108
94-
# Extract Debian revision from changelog
95-
DEBIAN_REVISION=$(head -1 debian/changelog | sed 's/.*(\(.*\)-\(.*\)).*/\2/')
96-
echo "debian_revision=$DEBIAN_REVISION" >> $GITHUB_OUTPUT
97-
98109
- name: Update changelog
99110
run: |
100111
VERSION="${{ steps.version.outputs.version }}"
101-
CURRENT_VERSION=$(head -1 debian/changelog | sed 's/.*(\(.*\)).*/\1/')
112+
# Per-series version suffix so each Ubuntu release has an independent
113+
# version line on Launchpad. The `+series1` suffix sorts strictly
114+
# higher than a plain `-1ubuntu1`, so future uploads always supersede
115+
# any previously published package.
116+
NEW_VERSION="${VERSION}-1ubuntu1+${{ matrix.ubuntu_release }}1"
102117
103-
if [ "$VERSION-1ubuntu1" != "$CURRENT_VERSION" ]; then
104-
echo "Updating changelog from $CURRENT_VERSION to $VERSION-1ubuntu1"
118+
DEBFULLNAME="${{ env.DEBFULLNAME }}" DEBEMAIL="${{ env.DEBEMAIL }}" \
119+
dch --newversion "$NEW_VERSION" \
120+
--distribution "${{ matrix.ubuntu_release }}" \
121+
"Build for ${{ matrix.ubuntu_release }} - upstream release $VERSION"
105122
106-
# Create new changelog entry
107-
DEBFULLNAME="${{ env.DEBFULLNAME }}" DEBEMAIL="${{ env.DEBEMAIL }}" \
108-
dch --newversion "$VERSION-1ubuntu1" \
109-
--distribution "questing" \
110-
"New upstream release $VERSION"
123+
echo "✓ Changelog set to $NEW_VERSION (${{ matrix.ubuntu_release }})"
111124
112-
echo "✓ Changelog updated"
113-
else
114-
echo "✓ Changelog already at correct version"
115-
fi
125+
- name: Pin Rust toolchain version per release
126+
run: |
127+
# Each Ubuntu release ships a different set of versioned rustc/cargo
128+
# packages. We pin to the lowest version available on the target
129+
# release that still satisfies our >= 1.88 floor (let-chains).
130+
case "${{ matrix.ubuntu_release }}" in
131+
questing) RUST_VERSION=1.88 ;;
132+
resolute) RUST_VERSION=1.91 ;;
133+
*) echo "::error::Unknown release ${{ matrix.ubuntu_release }} - add it to the case statement"; exit 1 ;;
134+
esac
135+
echo "Pinning to rustc-$RUST_VERSION / cargo-$RUST_VERSION for ${{ matrix.ubuntu_release }}"
136+
137+
sed -i -E "s/(cargo|rustc|rustdoc)-1\.[0-9]+/\1-${RUST_VERSION}/g" debian/control debian/rules
138+
139+
echo "--- debian/control build-depends ---"
140+
grep -E "(cargo|rustc)-1\." debian/control || true
141+
echo "--- debian/rules toolchain exports ---"
142+
grep -E "(CARGO|RUSTC|RUSTDOC) *=" debian/rules || true
116143
117144
- name: Build source package
118145
run: |
@@ -171,9 +198,14 @@ jobs:
171198
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
172199
run: |
173200
cd build-ppa
174-
VERSION="${{ steps.version.outputs.version }}"
175-
DEBIAN_REVISION="${{ steps.version.outputs.debian_revision }}"
176-
CHANGES_FILE="rustnet-monitor_${VERSION}-${DEBIAN_REVISION}_source.changes"
201+
# Locate the source.changes file produced by debuild. The version
202+
# suffix (+seriesN) is dynamic, so glob rather than reconstruct.
203+
CHANGES_FILE=$(ls rustnet-monitor_*_source.changes | head -1)
204+
if [ -z "$CHANGES_FILE" ]; then
205+
echo "::error::No source.changes file found in build-ppa"
206+
exit 1
207+
fi
208+
echo "Signing and uploading $CHANGES_FILE"
177209
178210
# Sign
179211
debsign -k${GPG_KEY_ID} ${CHANGES_FILE}
@@ -198,10 +230,14 @@ jobs:
198230

199231
- name: Summary
200232
run: |
233+
cd build-ppa
234+
CHANGES_FILE=$(ls rustnet-monitor_*_source.changes | head -1)
235+
FULL_VERSION=$(echo "$CHANGES_FILE" | sed 's/rustnet-monitor_\(.*\)_source\.changes/\1/')
236+
201237
echo "## 🎉 PPA Upload Complete" >> $GITHUB_STEP_SUMMARY
202238
echo "" >> $GITHUB_STEP_SUMMARY
203239
echo "- **Package**: rustnet-monitor" >> $GITHUB_STEP_SUMMARY
204-
echo "- **Version**: ${{ steps.version.outputs.version }}-${{ steps.version.outputs.debian_revision }}" >> $GITHUB_STEP_SUMMARY
240+
echo "- **Version**: $FULL_VERSION" >> $GITHUB_STEP_SUMMARY
205241
echo "- **Ubuntu**: ${{ matrix.ubuntu_release }}" >> $GITHUB_STEP_SUMMARY
206242
echo "" >> $GITHUB_STEP_SUMMARY
207243
echo "### Installation" >> $GITHUB_STEP_SUMMARY
@@ -210,4 +246,4 @@ jobs:
210246
echo "sudo apt update && sudo apt install rustnet" >> $GITHUB_STEP_SUMMARY
211247
echo '```' >> $GITHUB_STEP_SUMMARY
212248
echo "" >> $GITHUB_STEP_SUMMARY
213-
echo "[View PPA](https://launchpad.net/~domcyrus/+archive/ubuntu/rustnet/+packages)" >> $GITHUB_STEP_SUMMARY
249+
echo "[View PPA](https://launchpad.net/~domcyrus/+archive/ubuntu/rustnet/+packages)" >> $GITHUB_STEP_SUMMARY

INSTALL.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,12 @@ choco install rustnet
8989

9090
### Linux Package Installation
9191

92-
#### Ubuntu PPA (Recommended for Ubuntu 25.10+)
92+
#### Ubuntu PPA (Recommended for Ubuntu 25.10 Questing and 26.04 LTS Resolute)
9393

94-
The easiest way to install RustNet on Ubuntu is via the official PPA.
94+
The easiest way to install RustNet on Ubuntu is via the official PPA. The PPA publishes builds for the following Ubuntu series:
95+
96+
- Ubuntu 25.10 (Questing Quokka)
97+
- Ubuntu 26.04 LTS (Resolute Raccoon)
9598

9699
```bash
97100
# Add the RustNet PPA
@@ -111,7 +114,7 @@ sudo setcap 'cap_net_raw,cap_bpf,cap_perfmon+eip' /usr/bin/rustnet
111114
rustnet
112115
```
113116

114-
**Important:** The PPA only supports Ubuntu 25.10+ due to the Rust 1.88+ requirement. Earlier Ubuntu versions don't have a recent enough Rust compiler in their repositories. For older Ubuntu versions, use the [.deb packages](#debianubuntu-deb-packages) from GitHub releases or [build from source](#building-from-source).
117+
**Important:** The PPA supports only the two series listed above (Ubuntu 25.10 Questing and 26.04 LTS Resolute) because the build requires Rust 1.88+ (used for let-chains in the project). Earlier Ubuntu versions don't ship a recent enough `rustc` in their repositories. For older Ubuntu versions, use the [.deb packages](#debianubuntu-deb-packages) from GitHub releases or [build from source](#building-from-source).
115118

116119
#### Debian/Ubuntu (.deb packages)
117120

RELEASE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,16 @@ After GitHub Actions completes:
157157
- [ ] Verify FreeBSD build at https://github.com/domcyrus/rustnet-bsd
158158
- [ ] Announce release (if applicable)
159159

160+
## Maintenance: New Ubuntu and Fedora Releases
161+
162+
This is an occasional task, not part of every release. When a new Ubuntu interim or LTS, or a new Fedora release, is published and we want RustNet packages to ship for it:
163+
164+
1. **Ubuntu PPA**: add the new codename to the matrix in [`.github/workflows/ppa-release.yml`](.github/workflows/ppa-release.yml) (the `set-matrix` job's `releases=[...]` list and the `workflow_dispatch` choice options). Confirm the new series ships `rustc-1.88` (or whatever the current `rust-version` floor in `Cargo.toml` is). Reference: issue [#254](https://github.com/domcyrus/rustnet/issues/254) added Ubuntu 26.04 (Resolute) support.
165+
2. **Fedora COPR**: add the new chroot in the COPR project settings at [https://copr.fedorainfracloud.org/coprs/domcyrus/rustnet/edit/](https://copr.fedorainfracloud.org/coprs/domcyrus/rustnet/edit/). The chroot list is managed in the COPR UI, not in this repo.
166+
3. Trigger a `workflow_dispatch` of `Release to Ubuntu PPA` for the new codename to verify the build before relying on it from the next tagged release.
167+
168+
Conversely, when an older Ubuntu series is no longer worth supporting (no `rustc-1.88` in archive, or end of life), remove it from the same two locations and update [INSTALL.md](INSTALL.md) and [debian/README.md](debian/README.md) to match.
169+
160170
## Versioning
161171

162172
RustNet follows [Semantic Versioning (SemVer)](https://semver.org/):

debian/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ git tag v1.0.0
1111
git push origin v1.0.0
1212
```
1313

14-
This automatically builds and uploads to Ubuntu 25.10+ which has Rust 1.88+ for edition 2024 support.
14+
This automatically builds and uploads source packages for both supported Ubuntu series:
15+
16+
- Ubuntu 25.10 (Questing Quokka)
17+
- Ubuntu 26.04 LTS (Resolute Raccoon)
18+
19+
Both series ship `rustc-1.88` / `cargo-1.88`, which is the minimum required for the let-chains feature used by the project (see `rust-version` in `Cargo.toml`).
1520

1621
## GitHub Secrets Setup
1722

@@ -49,7 +54,7 @@ sudo apt install rustnet
4954
- **Binary**: rustnet
5055
- **Maintainer**: Marco Cadetg <cadetg@gmail.com>
5156
- **PPA**: https://launchpad.net/~domcyrus/+archive/ubuntu/rustnet
52-
- **Supported**: Ubuntu 25.10 and later
57+
- **Supported**: Ubuntu 25.10 (Questing) and 26.04 LTS (Resolute)
5358
- **Architectures**: amd64, arm64, armhf
5459

5560
## Workflow

0 commit comments

Comments
 (0)