-
Notifications
You must be signed in to change notification settings - Fork 77
85 lines (71 loc) · 3.12 KB
/
checkVersions.yml
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Check for and apply version increments
on:
workflow_call:
inputs:
botName:
description: The name of the bot that adds the necessary version increment changes
type: string
required: true
botMail:
description: The name of the bot that adds the necessary version increment changes
type: string
required: true
permissions: {} # all none
jobs:
versions-check-and-increment:
name: Check and increment service versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0 # required for jgit timestamp provider to work
- name: Set up Java
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
java-version: 17
distribution: 'temurin'
cache: maven
- name: Set up Maven
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
with:
maven-version: 3.9.9
- name: Check and increment versions
uses: Wandalen/wretry.action@ffdd254f4eaf1562b8a2c66aeaa37f1ff2231179 # master
with:
attempt_delay: 200
attempt_limit: 10
command: >
mvn verify -DskipTests -Dcompare-version-with-baselines.skip=false
org.eclipse.tycho:tycho-versions-plugin:bump-versions -Dtycho.bump-versions.increment=100
--threads 1C --fail-at-end --batch-mode --no-transfer-progress --show-version
- name: Commit version increments, if any
run: |
set -x
# Only stage files relevant for version increments and don't fail if the kind of file to be staged does not exist at all.
git add '*/META-INF/MANIFEST.MF' || true
git add '*/feature.xml' || true
git add '*/pom.xml' || true
if [[ $(git diff --name-only --cached) != '' ]]; then
# Relevant files were staged, i.e. some version were changed
# Read 'releaseNumberSDK' property as stream version
mvn help:evaluate -Dexpression=releaseNumberSDK --quiet '-Doutput=releaseNumberSDK-value.txt'
streamVersion=$(<releaseNumberSDK-value.txt)
rm -f releaseNumberSDK-value.txt
git config --global user.email '${{ inputs.botMail }}'
git config --global user.name '${{ inputs.botName }}'
git status
git commit -m "Version bump(s) for ${streamVersion} stream"
git format-patch -1 HEAD --no-stat --output 'version_increments.patch'
echo '${{ github.event.pull_request.number }}' > 'github_pull_request_number.txt'
echo "::error title=Version increments are missing::Required version increments are missing and a commit to apply them is about to be pushed to your PR's branch."
exit 1
else
echo 'No version increments required'
fi
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: always()
with:
name: versions-git-patch
path: |
version_increments.patch
github_pull_request_number.txt