11name : Build
2-
32on :
43 [push]
5-
64jobs :
75 build :
86 name : Build and Test
97 runs-on : ubuntu-latest
108 if : " !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
11- env :
12- BUILD_VERSION : SNAPSHOT
13- outputs :
14- artifact-version : ${{ steps.setversion.outputs.version }}
159 steps :
1610 - uses : actions/checkout@v2
1711 - uses : actions/setup-java@v1
1812 with :
1913 java-version : 11
20- server-id : bintray-jcenter
21- server-username : BINTRAY_USERNAME
22- server-password : BINTRAY_API_KEY
23- - uses : actions/cache@v1
14+ - uses : actions/cache@v2
2415 with :
2516 path : ~/.m2/repository
2617 key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
2718 restore-keys : |
2819 ${{ runner.os }}-maven-
2920 - name : Ensure to use tagged version
30- run : mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/}
3121 if : startsWith(github.ref, 'refs/tags/')
32- - name : Export the project version to the job environment and fix it as an ouput of this job
33- id : setversion
34- run : |
35- v=$(mvn help:evaluate "-Dexpression=project.version" -q -DforceStdout)
36- echo "BUILD_VERSION=${v}" >> $GITHUB_ENV
37- echo "::set-output name=version::${v}"
22+ run : mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/}
3823 - name : Build and Test
39- run : mvn -B install
40- - name : Upload snapshot artifact integrations-api-${{ env.BUILD_VERSION }}.jar build on Linux
41- uses : actions/upload-artifact@v2
24+ id : buildAndTest
25+ run : mvn -B clean install
26+ - uses : actions/upload-artifact@v2
4227 with :
43- name : integrations-api-${{ env.BUILD_VERSION }}.jar
44- path : target/integrations-api-*.jar
45- - name : Build and deploy to jcenter
28+ name : artifacts
29+ path : target/*.jar
30+ - name : Create Release
31+ uses : actions/create-release@v1
4632 if : startsWith(github.ref, 'refs/tags/')
47- run : mvn -B deploy -DskipTests
4833 env :
49- BINTRAY_USERNAME : cryptobot
50- BINTRAY_API_KEY : ${{ secrets.BINTRAY_API_KEY }}
34+ GITHUB_TOKEN : ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} # release as "cryptobot"
35+ with :
36+ tag_name : ${{ github.ref }}
37+ release_name : Release ${{ github.ref }}
38+ prerelease : true
0 commit comments