Skip to content

Commit 0527362

Browse files
committed
Add release workflow
1 parent fad5a47 commit 0527362

2 files changed

Lines changed: 55 additions & 0 deletions

File tree

.ci/scripts/release.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
set -eu -o pipefail
4+
5+
BRANCH=$(git branch --show-current)
6+
7+
if ! [[ "${BRANCH}" =~ ^RELEASE-[0-9]+\.[0-9]+$ ]]
8+
then
9+
echo ERROR: This is not a release branch!
10+
exit 1
11+
fi
12+
13+
NEW_VERSION="$(bump-my-version show new_version --increment release)"
14+
echo "Release ${NEW_VERSION}"
15+
16+
if ! [[ "RELEASE-${NEW_VERSION}" == "${BRANCH}"* ]]
17+
then
18+
echo ERROR: Version does not match release branch
19+
exit 1
20+
fi
21+
22+
bump-my-version bump release --commit --message "Release {new_version}" --tag --tag-name "v{new_version}" --tag-message "Release {new_version}"
23+
bump-my-version bump patch --commit
24+
25+
git push origin "${BRANCH}" "v${NEW_VERSION}"

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: "Tag Release"
3+
4+
on:
5+
workflow_dispatch:
6+
7+
jobs:
8+
release:
9+
name: "Release"
10+
runs-on: "ubuntu-latest"
11+
steps:
12+
- uses: "actions/checkout@v4"
13+
with:
14+
token: "${{ secrets.RELEASE_TOKEN }}"
15+
- name: "Set up Python"
16+
uses: "actions/setup-python@v5"
17+
with:
18+
python-version: "3.13"
19+
- name: "Install dependencies"
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install bump-my-version~=0.29.0
23+
- name: "Setup git"
24+
run: |
25+
git config user.name pulpbot
26+
git config user.email pulp-infra@redhat.com
27+
- name: "Release"
28+
run: |
29+
.ci/scripts/release.sh
30+
...

0 commit comments

Comments
 (0)