Skip to content

Commit c8517f0

Browse files
committed
release with new deb thing
1 parent 974e6af commit c8517f0

File tree

1 file changed

+26
-143
lines changed

1 file changed

+26
-143
lines changed

.github/workflows/on_release.yml

Lines changed: 26 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -5,156 +5,39 @@ on:
55
tags:
66
- 'v*'
77

8-
env:
9-
ROS_DISTRO: humble
10-
DEBIAN_FRONTEND: noninteractive
11-
128
jobs:
13-
validate-tag:
14-
name: ✅ Validate tag and extract version info
15-
runs-on: ubuntu-22.04
16-
outputs:
17-
version: ${{ steps.extract.outputs.version }}
18-
revision: ${{ steps.extract.outputs.revision }}
9+
build-test-and-release:
10+
strategy:
11+
fail-fast: true
12+
matrix:
13+
include:
14+
- ros_distro: rolling
15+
debian_distro: noble
16+
ubuntu_version: '24.04'
17+
18+
- ros_distro: kilted
19+
debian_distro: noble
20+
ubuntu_version: '24.04'
21+
22+
- ros_distro: jazzy
23+
debian_distro: noble
24+
ubuntu_version: '24.04'
25+
26+
- ros_distro: humble
27+
debian_distro: jammy
28+
ubuntu_version: '22.04'
1929

20-
steps:
21-
- name: 🧪 Validate tag format
22-
run: |
23-
TAG="${GITHUB_REF_NAME#refs/tags/}"
24-
if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-r[0-9]+)?$ ]]; then
25-
echo "❌ Invalid tag format: $TAG"
26-
echo "✅ Expected: v<major>.<minor>.<patch> or v<major>.<minor>.<patch>-r<revision>"
27-
exit 1
28-
fi
29-
echo "✅ Tag format OK: $TAG"
30-
31-
- name: 📦 Extract version, revision and check package.xmls
32-
id: extract
33-
run: |
34-
set -euo pipefail
35-
36-
TAG="${GITHUB_REF_NAME#refs/tags/v}"
37-
VERSION=$(echo "$TAG" | cut -d'-' -f1)
38-
REVISION=$(echo "$TAG" | grep -o 'r[0-9]*$' | sed 's/r//')
39-
REVISION=${REVISION:-1}
40-
41-
echo "📦 Extracted version: $VERSION"
42-
echo "📦 Extracted revision: $REVISION"
43-
44-
MISMATCH=0
45-
for pkg_xml in $(find . -name package.xml); do
46-
PKG_VERSION=$(xmlstarlet sel -t -v "//version" "$pkg_xml")
47-
echo "🔍 $pkg_xml → $PKG_VERSION"
48-
if [[ "$PKG_VERSION" != "$VERSION" ]]; then
49-
echo "❌ Mismatch: expected $VERSION"
50-
MISMATCH=1
51-
fi
52-
done
53-
54-
if [[ "$MISMATCH" -ne 0 ]]; then
55-
echo "❌ One or more package.xml files do not match the tag version."
56-
exit 1
57-
fi
58-
59-
echo "✅ All package.xml versions match."
60-
61-
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
62-
echo "revision=$REVISION" >> "$GITHUB_OUTPUT"
63-
64-
build-and-test:
65-
name: 🔨 Build & Test
66-
runs-on: ubuntu-22.04
67-
needs: validate-tag
6830
steps:
6931
- uses: actions/checkout@v3
7032
- uses: ros-tooling/setup-ros@v0.7
7133
with:
72-
required-ros-distributions: ${{ env.ROS_DISTRO }}
34+
required-ros-distributions: ${{ matrix.ros_distro }}
7335
- uses: ./.github/actions/build-and-test
7436

75-
release:
76-
name: 📦 Package & ☁️ Upload to S3
77-
runs-on: ubuntu-22.04
78-
needs: [validate-tag, build-and-test]
79-
env:
80-
VERSION: ${{ needs.validate-tag.outputs.version }}
81-
REVISION: ${{ needs.validate-tag.outputs.revision }}
82-
83-
steps:
84-
- name: 🔄 Checkout repository
85-
uses: actions/checkout@v3
86-
87-
- name: 🛠 Setup ROS 2
88-
uses: ros-tooling/setup-ros@v0.7
37+
- uses: watonomous/bloom-release-ros@v0.1.0
8938
with:
90-
required-ros-distributions: ${{ env.ROS_DISTRO }}
91-
92-
- name: 🧰 Install packaging dependencies
93-
run: |
94-
sudo apt update
95-
sudo apt install -y \
96-
python3-colcon-common-extensions \
97-
python3-catkin-pkg \
98-
python3-bloom \
99-
build-essential \
100-
fakeroot \
101-
dpkg-dev \
102-
dpkg-scanpackages \
103-
devscripts \
104-
gnupg \
105-
apt-utils \
106-
xmlstarlet \
107-
awscli
108-
109-
- name: 📝 Update Debian changelog
110-
run: |
111-
dch --create --package ros-${{ env.ROS_DISTRO }}-deep_ros \
112-
--newversion "${VERSION}-${REVISION}" \
113-
"Auto-generated release for Deep ROS"
114-
115-
- name: 🧱 Build package
116-
run: colcon build --merge-install --packages-select deep_ros
39+
ros_distro: ${{ matrix.ros_distro }}
40+
debian_distro: ${{ matrix.debian_distro }}
41+
packages_dir: ${{ matrix.packages_dir }}
11742

118-
- name: 📦 Generate .deb package
119-
run: |
120-
mkdir -p apt_repo/dists/latest/main/binary-all
121-
mkdir -p apt_repo/dists/$VERSION/main/binary-all
122-
bloom-generate rosdebian --ros-distro $ROS_DISTRO
123-
fakeroot debian/rules binary
124-
mv ../*.deb apt_repo/dists/latest/main/binary-all/
125-
cp apt_repo/dists/latest/main/binary-all/*.deb \
126-
apt_repo/dists/$VERSION/main/binary-all/
127-
128-
- name: 📜 Generate APT metadata
129-
run: |
130-
for version in latest "$VERSION"; do
131-
BIN_DIR="apt_repo/dists/$version/main/binary-all"
132-
RELEASE_DIR="apt_repo/dists/$version"
133-
134-
mkdir -p "$BIN_DIR"
135-
pushd "$BIN_DIR" > /dev/null
136-
dpkg-scanpackages . /dev/null > Packages
137-
gzip -9c Packages > Packages.gz
138-
popd > /dev/null
139-
140-
echo "Origin: Deep ROS" > "$RELEASE_DIR/Release"
141-
echo "Label: Deep ROS" >> "$RELEASE_DIR/Release"
142-
echo "Suite: stable" >> "$RELEASE_DIR/Release"
143-
echo "Version: $version" >> "$RELEASE_DIR/Release"
144-
echo "Codename: deep_ros" >> "$RELEASE_DIR/Release"
145-
echo "Architectures: all" >> "$RELEASE_DIR/Release"
146-
echo "Components: main" >> "$RELEASE_DIR/Release"
147-
echo "Description: Deep ROS ROS 2 SLAM System" >> "$RELEASE_DIR/Release"
148-
done
149-
150-
- name: ☁️ Upload APT repo to S3
151-
uses: jakejarvis/s3-sync-action@v0.5.1
152-
with:
153-
args: --acl public-read --follow-symlinks
154-
env:
155-
AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }}
156-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
157-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
158-
AWS_REGION: ${{ secrets.AWS_REGION }}
159-
SOURCE_DIR: apt_repo
160-
DEST_DIR: .
43+
-

0 commit comments

Comments
 (0)