-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (34 loc) · 1.02 KB
/
release.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
name: build image on release
on:
release:
types:
- published
jobs:
build-image:
runs-on: ubuntu-latest
env:
RELEASE_NAME: ${{ github.ref_name}}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'temurin'
- name: Grant execute permission for Gradlew
run: chmod +x gradlew
- name: check release name matches version pattern
run: |
PATTERN="^([0-9]+\.[0-9]+\.[0-9]+)(-[A-Za-z]+(-[0-9]+))?$"
if [[ $RELEASE_NAME =~ $PATTERN ]]; then
echo "The RELEASE_NAME '$RELEASE_NAME' is valid."
else
echo "The RELEASE_NAME '$RELEASE_NAME' is invalid."
exit 1
fi
- name: Build, run tests and publish
env:
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew -Pversion=$RELEASE_NAME publish