-
Notifications
You must be signed in to change notification settings - Fork 1
/
release.sh
executable file
·34 lines (28 loc) · 1.41 KB
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
#
# A script for editing .github/project.yml file, committing the changes and pushing the branch
# to [email protected]:quarkiverse/quarkus-antora.git
# The invocation would normally look like the following:
#
# ./release.sh 1.2.3 1.2.4-SNAPSHOT
#
# After the script pushes to [email protected]:quarkiverse/quarkus-antora.git
# you need to create a pull request against the appropriate release branch, such as main or 1.5
# You do not need to wait for the CI, just merge the PR straight away.
# That should trigger the release job defined in .github/workflows/release.yml.
# You can find the job under https://github.com/quarkiverse/quarkus-antora/actions
# and watch whether it runs smoothly.
set -x
set -e
releaseVersion="$1"
nextVersion="$2"
topicBranch=trigger-release-$releaseVersion
git checkout -b $topicBranch
sed -i -e 's| current-version:.*| current-version: '$releaseVersion'|' .github/project.yml
sed -i -e 's| next-version:.*| next-version: '$nextVersion'|' .github/project.yml
# current-major-minor-version is only used in maintenance branches like 1.5 to set the version in antora.yml
releaseVersionMajorMinor=$(echo $releaseVersion | sed 's|.[0-9][0-9]*$||')
sed -i -e 's| current-major-minor-version:.*| current-major-minor-version: '$releaseVersionMajorMinor'|' .github/project.yml
git add -A
git commit -m "Trigger release $releaseVersion"
git push [email protected]:quarkiverse/quarkus-antora.git $topicBranch