Skip to content

Commit

Permalink
TSK-1946: fix release job due to missing dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mustaphazorgati committed Feb 14, 2023
1 parent 3b07d4d commit f6a5562
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ jobs:
path: ~/.m2
key: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}
- name: Change versions to match tag
run: ci/change_version.sh -m .
- name: Compile & build
run: ./mvnw -B install -DskipTests -Dasciidoctor.skip -Djacoco.skip
- name: Populate cache
Expand Down Expand Up @@ -205,6 +207,8 @@ jobs:
with:
name: ${{ env.ARTIFACTS_TASKANA_JARS_NAME }}
path: ${{ env.ARTIFACTS_TASKANA_JARS_PATH }}
- name: Change versions to match tag
run: ci/change_version.sh -m .
# Theoretically this step below not necessary because we reuse the cache from the 'compile_frontend' job.
# Sometimes the cache is not created, therefore this is a fallback.
- name: Populate cache
Expand Down Expand Up @@ -311,6 +315,10 @@ jobs:
with:
name: ${{ env.ARTIFACTS_TASKANA_JARS_NAME }}
path: ${{ env.ARTIFACTS_TASKANA_JARS_PATH }}
- name: Change versions to match tag
run: |
ci/change_version.sh -m .
ci/update_taskana_dependency_for_wildfly.sh
- name: Generate JavaDoc for Rest Documentation
if: matrix.module == 'taskana-simplehistory-rest-spring'
run: ./mvnw -B validate -pl :taskana-rest-spring
Expand Down Expand Up @@ -394,7 +402,7 @@ jobs:
- name: Update version to next snapshot and push back
run: |
ci/change_version.sh -i -m .
ci/update_taskana_dependency_for_wildfly.sh
ci/update_taskana_dependency_for_wildfly.sh -i
ci/commitPoms.sh rest/taskana-rest-spring-example-wildfly/src/test/java/pro/taskana/example/wildfly/AbstractAccTest.java
env:
GH_EMAIL: ${{ secrets.GH_EMAIL }}
Expand Down
2 changes: 1 addition & 1 deletion ci/change_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -e #fail fast
#H
#H prints this help and exits
#H
#H %FILE% <-m modules...> [-i]
#H %FILE% <m modules...> [-i]
#H
#H if a release version exists (extracted from GITHUB_REF)
#H the maven versions of all modules will be changed to the given release version.
Expand Down
22 changes: 18 additions & 4 deletions ci/update_taskana_dependency_for_wildfly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ set -e #fail fast
#H
#H prints this help and exits
#H
#H %FILE%
#H %FILE% [-i]
#H
#H if a release version exists (extracted from GITHUB_REF environment variable)
#H the taskana dependency in our wildfly example project will be incremented to the new version snapshot.
#H the taskana dependency in our wildfly example project will be incremented to the new version.
#H
#H i:
#H increments version to next snapshot
# Arguments:
# $1: exit code
function helpAndExit() {
Expand All @@ -36,12 +38,24 @@ function main() {
[[ "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
if [[ "$GITHUB_REF" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
REL=$(dirname "$0")
while [[ $# -gt 0 ]]; do
case $1 in
-i)
INCREMENT="true"
shift # passed argument
;;
*) # unknown option
echo "unknown parameter $1" >&2
exit 1
;;
esac
done
FILES=(
"$REL/../rest/taskana-rest-spring-example-wildfly/pom.xml"
"$REL/../rest/taskana-rest-spring-example-wildfly/src/test/java/pro/taskana/example/wildfly/AbstractAccTest.java"
)
version=$([[ -n "$INCREMENT" ]] && echo "$(increment_version "${GITHUB_REF##refs/tags/v}")-SNAPSHOT" || echo "${GITHUB_REF##refs/tags/v}")
for file in "${FILES[@]}"; do
sed -i "s/[0-9]\+\.[0-9]\+\.[0-9]\+-SNAPSHOT/$(increment_version "${GITHUB_REF##refs/tags/v}")-SNAPSHOT/g" "$file"
sed -i "s/\"[0-9]\+\.[0-9]\+\.[0-9]\+\(-SNAPSHOT\)\?\"/\"${version}\"/g" "$file"
done
else
echo "skipped version change for wildfly because this is not a release build"
Expand Down

0 comments on commit f6a5562

Please sign in to comment.