Skip to content

Commit

Permalink
test tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Schwager committed Feb 13, 2025
1 parent 643736e commit a2e420e
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# SPDX-FileCopyrightText: 2025 Deutsche Telekom AG and others
#
# SPDX-License-Identifier: Apache-2.0

name: Prepare Release

on:
push:
tags:
- 'release'
- 'release-milestone'

jobs:
build-and-release-milestone:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: pipeline
#ref: main
- name: Create release tag
run: |
git config --global user.email "[email protected]" && git config --global user.name "CICD"
git push origin ':${{ github.ref_name }}'
version=$(sed -n -E 's/^version[[:blank:]]*=[[:blank:]]*(.*)-SNAPSHOT$/\1/p' gradle.properties)
if [ "${{ github.ref_name }}" == "release-milestone" ]; then
oldMilestone=$(git tag -l "0.1.1-M*" --sort=v:refname | tail -n 1)
if [ "${oldMilestone}" == "" ]; then
version=${version}-M1
else
version=${version}-M$((10#${oldMilestone##*-M}+1))
fi
fi
echo "releasing milestone ${version}"
sed -i "s/^version[[:blank:]]*=.*$/version=$version/" gradle.properties
git commit -am "Release $version"
git tag -a "$version" -m "Release $version"
git push origin "$version"
if [ "${{ github.ref_name }}" != "release-milestone" ]; then
minor=$(echo $version | cut -d. -f2)
version=${version%%.*}.$((minor+1)).0-SNAPSHOT
sed -i "s/^version[[:blank:]]*=.*$/version=$version/" gradle.properties
git commit -am "Increase snapshot version to $version"
git push origin main
fi
#TODO Hotfix over hotfix branch

0 comments on commit a2e420e

Please sign in to comment.