Skip to content

Commit f4ff207

Browse files
Creation of the release workflow
Signed-off-by: Simon Beaudoin <[email protected]>
1 parent f34a084 commit f4ff207

File tree

1 file changed

+39
-28
lines changed

1 file changed

+39
-28
lines changed

.github/workflows/qcom-release-reusable-workflow.yml

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,11 @@ on:
1010
type: string
1111
required: true
1212

13-
14-
pkg-repo:
15-
description: The upstream package repo against which to try the build
16-
type: string
17-
required: true
18-
1913
distro-codename:
2014
description: The distribution codename to build for. Ex noble, jammy, etc
2115
type: string
2216
default: noble
2317

24-
runner:
25-
description: The runner to use for the build
26-
type: string
27-
default: ubuntu-latest
28-
2918
secrets:
3019
TOKEN:
3120
required: true
@@ -35,24 +24,22 @@ permissions:
3524
security-events: write
3625

3726
jobs:
38-
gkg-release:
27+
pkg-release:
3928

40-
runs-on: ${{inputs.runner}}
29+
runs-on: ubuntu-latest
4130

4231
defaults:
4332
run:
4433
shell: bash
4534

4635
steps:
4736

48-
- name: Print caller info
49-
run: |
50-
echo "pkg-repo : ${{inputs.pkg-repo}}"
37+
- name: Install devscripts
38+
run: sudo apt update && sudo apt install -y devscripts
5139

5240
- name: Checkout Packaging Repo
5341
uses: actions/checkout@v4
5442
with:
55-
repository: ${{inputs.pkg-repo}}
5643
clean: false
5744
token: ${{secrets.TOKEN}}
5845
path: ./package-repo
@@ -61,35 +48,59 @@ jobs:
6148

6249
- name: Changelog suite name change
6350
run: |
64-
cd ./package-repo/debian
65-
cat changelog
51+
cd ./package-repo
52+
53+
git checkout debian/latest
54+
55+
cat debian/changelog
6656
6757
# Check if the latest changelog entry suite is UNRELEASED
68-
if ! head -1 changelog | grep -q '(UNRELEASED)'; then
69-
echo "Error: The suite in the latest changelog entry is not UNRELEASED."
58+
if ! head -1 debian/changelog | grep -q 'UNRELEASED'; then
59+
echo "Error: The suite in the latest changelog entry is not UNRELEASED." \
60+
"The release process expects the latest entry to be UNRELEASED at any point except in the commit (this one) that represents the release"
7061
exit 1
7162
fi
7263
73-
sed -i 's/UNRELEASED/unstable/' changelog
74-
cat changelog
64+
#Update the changelog timestamp
65+
dch --release --distribution=unstable "Release"
66+
67+
cat debian/changelog
7568
7669
- name: Commit changelog suite change
7770
run: |
78-
cd ./package-repo/debian
71+
cd ./package-repo
7972
8073
git config user.name "${{vars.DEB_PKG_BOT_CI_NAME}}"
8174
git config user.email "${{vars.DEB_PKG_BOT_CI_EMAIL}}"
8275
76+
export DEBFULLNAME="${{vars.DEB_PKG_BOT_CI_NAME}}"
77+
export DEBEMAIL="${{vars.DEB_PKG_BOT_CI_EMAIL}}"
78+
8379
version=$(dpkg-parsechangelog --show-field Version)
8480
8581
git commit -a -m "Release version ${version}"
8682
8783
git tag debian/${version}
8884
89-
sed -i 's/unstable/UNRELEASED/' changelog
85+
# bump Debian revision (last hyphen-separated field), e.g. 1.0.0-1 -> 1.0.0-2
86+
if [[ "$version" != *-* ]]; then
87+
echo "Error: version '$version' has no debian revision part" >&2
88+
exit 1
89+
fi
90+
91+
upstream="${version%-*}"
92+
rev="${version##*-}"
9093
91-
#TODO here we will want to bump the distro version for next dev cycle
92-
git commit -a -m "Initial commit of new version ${version}"
94+
if ! [[ "$rev" =~ ^[0-9]+$ ]]; then
95+
echo "Error: debian revision '$rev' is not numeric" >&2
96+
exit 1
97+
fi
9398
99+
rev=$((rev + 1))
100+
newversion="${upstream}-${rev}"
101+
echo "Bumped version -> ${newversion}"
102+
dch --newversion=${newversion} --distribution=UNRELEASED --controlmaint "Initial commit"
94103
95-
104+
git commit -a -m "Initial commit of new version ${newversion}"
105+
git push origin debian/latest
106+
git push origin debian/${version}

0 commit comments

Comments
 (0)