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}"
3822 shell : bash
23+ run : |
24+ mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/}
3925 - name : Build and Test
40- run : mvn -B install
41- - name : Upload .jars
42- uses : actions/upload-artifact@v2
26+ id : buildAndTest
27+ run : mvn -B clean install
28+ - uses : actions/upload-artifact@v2
4329 with :
44- name : integrations-linux-${{ env.BUILD_VERSION }}
45- path : target/integrations-linux-*.jar
46- - name : Build and deploy to jcenter
30+ name : artifacts
31+ path : target/*.jar
32+ - name : Create Release
33+ uses : actions/create-release@v1
4734 if : startsWith(github.ref, 'refs/tags/')
48- run : mvn -B deploy -DskipTests
4935 env :
50- BINTRAY_USERNAME : cryptobot
51- BINTRAY_API_KEY : ${{ secrets.BINTRAY_API_KEY }}
36+ GITHUB_TOKEN : ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} # release as "cryptobot"
37+ with :
38+ tag_name : ${{ github.ref }}
39+ release_name : Release ${{ github.ref }}
40+ prerelease : true
0 commit comments