-
Notifications
You must be signed in to change notification settings - Fork 16
43 lines (34 loc) · 1.23 KB
/
release_validation.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
name: Check for release
on:
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Remove -SNAPSHOT from pom.xml, and get version string which is to be released.
run: |
sed -i 's|\-SNAPSHOT||' pom.xml
echo "RELEASE_VERSION=$(mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
- name: Version validation
run: |
VERSION_IN_PROPERTIES_FILE=$(sed -n -e "s/^io\.personium\.core\.version=\(.*\)/\1/p" src/main/resources/personium-unit-config-default.properties)
if [ "$VERSION_IN_PROPERTIES_FILE" != "$RELEASE_VERSION" ]; then
echo "Version in properties file does not match RELEASE_VERSION(\"$VERSION_IN_PROPERTIES_FILE\" and \"$RELEASE_VERSION\")"
exit 1
fi
- name: Revert all changes
run: |
git checkout .