-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.9 KB
/
deploy.yaml
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
name: Deploy
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
name: Deploying
steps:
- uses: actions/checkout@v2
- uses: joschi/setup-jdk@v1
with:
java-version: openjdk11
- uses: actions/cache@v1
if: runner.os != 'Windows'
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Prep version
run: |
mvn -q build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.incrementalVersion} versions:commit
- name: Maven deploy
env:
USERNAME: rferreira
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn -B -DskipTests -pl '!jujube-benchmark,!jujube-example' -s .github/workflows/settings.xml deploy
- name: Tag release and rev version
run: |
# tagging release:
VERSION=$(grep \<version\> pom.xml | xargs | awk -F '[<>]' '{ print $3}')
echo "################### using version: v$VERSION ###################"
# tag repo
git config --global user.email "[email protected]"
git config --global user.name "CI"
git tag -a v"${VERSION}" -m "Release by Github Actions v${VERSION}"
git push origin v"${VERSION}"
# bumping it to a new snapshot release:
mvn -q build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.0-SNAPSHOT versions:commit
VERSION=$(grep \<version\> pom.xml | xargs | awk -F '[<>]' '{ print $3}')
echo "next version is: $VERSION"
#commit version change
git status
git commit -a -m "bump to ${VERSION} [ci skip]"
git push origin master