-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (45 loc) · 1.72 KB
/
master-deploy.yml
File metadata and controls
52 lines (45 loc) · 1.72 KB
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
name: Master Deploy
on:
pull_request:
branches:
- 'master'
types:
- closed
env:
ARCHIVA_USERNAME: ${{ secrets.SECRET_ARCHIVA_USERNAME }}
ARCHIVA_PASSWORD: ${{ secrets.SECRET_ARCHIVA_PASSWORD }}
jobs:
master-compile-test-deploy-and-release:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '16'
- name: Master Compile
run: |
#Add maven settings.xml
MAVEN_HOME=`./mvnw -version | grep "Maven home" | cut -d':' -f2 | sed -r "s# ##g"`
cp ./settings.xml ${MAVEN_HOME}/conf/settings.xml
# Add user for repository
git config --local user.email "remi.sultan@gmail.com"
git config --local user.name "JavaML autodeploy"
git config push.followTags true
# Setting the Release version to pom
app_version=$(grep -rE "version.next=[0-9]+\.[0-9]+\.[0-9]+" version.properties | cut -d"=" -f2)
./set-version.sh release
git add pom.xml */pom.xml version.properties
git commit -m "release: v-$app_version"
git tag -a -m "$app_version" "$app_version"
# Build and Install to verify
./mvnw clean install
# Setting the next developement iteration
./set-version.sh snapshot
git add pom.xml */pom.xml version.properties
git commit -m "chore: jumping onto next development iteration"
- name: Push changes made
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master