Skip to content

Commit 4dd7c80

Browse files
committed
Support generating alpha releases for GrimoireLab
This updated workflow will generate releases only for grimoirelab-core, grimoirelab-chronicler, and grimoirelab 2.x alpha versions. Releases for other packages will not be created until a final release is made. Signed-off-by: Jose Javier Merchante <[email protected]>
1 parent dbb9863 commit 4dd7c80

File tree

9 files changed

+231
-487
lines changed

9 files changed

+231
-487
lines changed

.github/workflows/docker-image.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ jobs:
3232
tags: |
3333
# Generate a raw tag so latest is not used
3434
type=raw,value=${{ inputs.version }}
35+
type=raw,value=2.x
36+
build-args: |
37+
GRIMOIRELAB_RELEASE=${{ inputs.version }}
3538
3639
- name: Set up QEMU
3740
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0

.github/workflows/grimoirelab-release.yml

Lines changed: 41 additions & 239 deletions
Large diffs are not rendered by default.

.github/workflows/release-grimoirelab-component.yml

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,20 @@ on:
1111
description: 'Git config name'
1212
type: string
1313
required: true
14-
release_candidate:
15-
description: 'Create a release candidate version'
14+
prerelease:
15+
description: 'Create a prerelease version'
1616
type: string
1717
required: true
18+
prerelease_label:
19+
description: 'Label for the prerelease version'
20+
type: string
21+
required: false
22+
default: 'rc'
1823
bump_major:
1924
description: 'Create a new major version release'
2025
type: string
21-
required: true
26+
required: false
27+
default: 'false'
2228
module_name:
2329
description: 'Name of the module'
2430
type: string
@@ -63,10 +69,10 @@ jobs:
6369
steps:
6470
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
6571

66-
- name: Set up Python 3.11
72+
- name: Set up Python
6773
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
6874
with:
69-
python-version: 3.11
75+
python-version: 3.12
7076

7177
- name: Set up Git config
7278
run: |
@@ -83,10 +89,9 @@ jobs:
8389
cd ${{ inputs.module_directory }}
8490
git checkout main
8591
86-
- name: Install poetry
92+
- name: Install Poetry
8793
run: |
88-
curl -sSL https://install.python-poetry.org | python3 -
89-
echo "PATH=$HOME/.poetry/bin:$PATH" >> $GITHUB_ENV
94+
pipx install poetry
9095
shell: bash
9196

9297
- name: Install release-tools
@@ -143,9 +148,9 @@ jobs:
143148
continue-on-error: true
144149
shell: bash {0}
145150
run: |
146-
if [ ${{ inputs.release_candidate }} == 'true' ]
151+
if [ ${{ inputs.prerelease }} == 'true' ]
147152
then
148-
rcArg='--pre-release'
153+
rcArg='--pre-release --pre-release-label ${{ inputs.prerelease_label }}'
149154
else
150155
rcArg=''
151156
fi
@@ -164,9 +169,9 @@ jobs:
164169
echo "Dependencies updated, force new version"
165170
version=$(semverup --bump-version patch $rcArg)
166171
echo "forced_version=true" >> $GITHUB_OUTPUT
167-
elif [ -z $version ] && [ ${{ inputs.release_candidate }} != 'true' ] && [[ "$old_version" =~ .*rc.* ]]
172+
elif [ -z $version ] && [ ${{ inputs.prerelease }} != 'true' ] && [[ "$old_version" =~ (alpha|beta|rc) ]]
168173
then
169-
echo "Create final version from rc"
174+
echo "Create final version from pre-release"
170175
version=$(semverup --bump-version patch)
171176
echo "forced_version=true" >> $GITHUB_OUTPUT
172177
else
@@ -193,7 +198,7 @@ jobs:
193198
version=${{ steps.version.outputs.version }}
194199
eof="EOF$(date +%s)"
195200
release_file="releases/$version.md"
196-
if [ ${{ inputs.release_candidate }} == 'true' ]
201+
if [ ${{ inputs.prerelease }} == 'true' ]
197202
then
198203
newsArg=''
199204
rcArg='--pre-release'
@@ -213,8 +218,8 @@ jobs:
213218
214219
* Update Poetry's package dependencies
215220
EOF
216-
# Update NEWS file if it is not a release candidate
217-
if [ ${{ inputs.release_candidate }} != 'true' ]
221+
# Update NEWS file if it is not a pre-release
222+
if [ ${{ inputs.prerelease }} != 'true' ]
218223
then
219224
mv NEWS old_NEWS
220225
echo -e "# Releases\n" >> NEWS
@@ -241,7 +246,7 @@ jobs:
241246
name: Publish new version.
242247
if: steps.semverup.outcome == 'success'
243248
run: |
244-
if [ ${{ inputs.release_candidate }} == 'true' ]
249+
if [ ${{ inputs.prerelease }} == 'true' ]
245250
then
246251
publish ${{ steps.version.outputs.version }} "${{ inputs.git_name }} <${{ inputs.git_email }}>" --push origin --remote-branch main --no-cleanup
247252
else

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
- name: Install dependencies
3636
run: |
3737
poetry install --with tests -vvv
38+
poetry run pip install -r requirements_dev.txt
3839
- name: Tests
3940
run: |
4041
cd tests && poetry run pytest

.gitmodules

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
path = src/grimoirelab-toolkit
2121
url = https://github.com/chaoss/grimoirelab-toolkit.git
2222
[submodule "src/grimoirelab-chronicler"]
23-
path = src/grimoirelab-chronicler
24-
url = https://github.com/grimoirelab/grimoirelab-chronicler.git
23+
path = src/grimoirelab-chronicler
24+
url = https://github.com/grimoirelab/grimoirelab-chronicler.git
2525
[submodule "src/grimoirelab-core"]
26-
path = src/grimoirelab-core
27-
url = https://github.com/grimoirelab/grimoirelab-core.git
26+
path = src/grimoirelab-core
27+
url = https://github.com/grimoirelab/grimoirelab-core.git

docker/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ FROM python:3.12-slim-bullseye
55

66
LABEL maintainer="Santiago Dueñas <[email protected]>"
77

8+
ARG GRIMOIRELAB_RELEASE="2.x"
9+
810
ENV DEBIAN_FRONTEND=noninteractive
911
ENV DEPLOY_USER=grimoirelab
10-
ENV GRIMOIRELAB_RELEASE="2.x"
12+
ENV GRIMOIRELAB_RELEASE=${GRIMOIRELAB_RELEASE}
1113

1214
# Create a user and a group
1315
RUN groupadd -r $DEPLOY_USER && useradd -r -m -g $DEPLOY_USER $DEPLOY_USER

0 commit comments

Comments
 (0)