1616 steps :
1717 - uses : actions/checkout@v2
1818 - name : Set up JDK
19- uses : actions/setup-java@main
19+ uses : actions/setup-java@v2.5.0
2020 with :
2121 distribution : ' adopt'
2222 java-version : ' 8'
@@ -26,13 +26,44 @@ jobs:
2626 key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
2727 restore-keys : |
2828 ${{ runner.os }}-maven-
29- - name : build & deploy
30- if : " contains(github.ref, 'master')"
31- run : |
32- chmod +x "${GITHUB_WORKSPACE}/maven-install.sh"
33- "${GITHUB_WORKSPACE}/maven-install.sh"
3429 - name : build
35- if : " !contains(github.ref, 'master')"
3630 run : |
3731 chmod +x "${GITHUB_WORKSPACE}/maven-install-local.sh"
38- "${GITHUB_WORKSPACE}/maven-install-local.sh"
32+ "${GITHUB_WORKSPACE}/maven-install-local.sh"
33+
34+ release :
35+ name : Release Admin theme to maven central
36+ runs-on : ubuntu-18.04
37+ needs : build
38+ env :
39+ user : ${{ secrets.user }}
40+ pass : ${{ secrets.pass }}
41+ GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
42+ steps :
43+ - uses : actions/checkout@v2
44+ - name : Set up JDK
45+ uses : actions/setup-java@v2.5.0
46+ with :
47+ distribution : ' adopt'
48+ java-version : ' 8'
49+ server-id : releases
50+ server-username : user
51+ server-password : pass
52+ gpg-private-key : ${{ secrets.GPG_PRIVATE_KEY }}
53+ gpg-passphrase : GPG_PASSPHRASE
54+ - uses : actions/cache@v1
55+ with :
56+ path : ~/.m2/repository
57+ key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
58+ restore-keys : |
59+ ${{ runner.os }}-maven-
60+ - name : Deploy snapshots
61+ if : " contains(github.ref, 'master') && !contains(github.event.head_commit.message, 'prepare release')"
62+ run : |
63+ chmod +x "${GITHUB_WORKSPACE}/release-snapshots.sh"
64+ "${GITHUB_WORKSPACE}/release-snapshots.sh"
65+ - name : Release
66+ if : " contains(github.ref, 'master') && contains(github.event.head_commit.message, 'prepare release')"
67+ run : |
68+ chmod +x "${GITHUB_WORKSPACE}/release.sh"
69+ "${GITHUB_WORKSPACE}/release.sh"
0 commit comments