1
1
name : Build
2
-
3
2
on :
4
3
[push]
5
-
6
4
jobs :
7
5
build :
8
6
name : Build and Test
9
7
runs-on : ubuntu-latest
10
8
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 }}
15
9
steps :
16
10
- uses : actions/checkout@v2
17
11
- uses : actions/setup-java@v1
18
12
with :
19
13
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
24
15
with :
25
16
path : ~/.m2/repository
26
17
key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
27
18
restore-keys : |
28
19
${{ runner.os }}-maven-
29
20
- name : Ensure to use tagged version
30
- run : mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/}
31
21
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}"
38
22
shell : bash
23
+ run : |
24
+ mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/}
39
25
- 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 -Pdependency-check
28
+ - uses : actions/upload-artifact@v2
43
29
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
47
34
if : startsWith(github.ref, 'refs/tags/')
48
- run : mvn -B deploy -DskipTests
49
35
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