@@ -3,15 +3,14 @@ name: Build
33on :
44 [push]
55
6- env :
7- BUILD_VERSION : SNAPSHOT
8-
96jobs :
107 build :
118 name : Build and Test
129 runs-on : ubuntu-latest
1310 outputs :
1411 artifact-version : ${{ steps.setversion.outputs.version }}
12+ env :
13+ BUILD_VERSION : SNAPSHOT
1514 steps :
1615 - uses : actions/checkout@v2
1716 - uses : actions/setup-java@v1
2625 - name : Ensure to use tagged version
2726 run : mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/} # use shell parameter expansion to strip of 'refs/tags'
2827 if : startsWith(github.ref, 'refs/tags/')
29- - name : Export the build version to the environment and fix it as an ouput of this job
28+ - name : Export the project version to the job environment and fix it as an ouput of this job
3029 id : setversion
3130 run : |
3231 v=$(mvn help:evaluate "-Dexpression=project.version" -q -DforceStdout)
@@ -37,11 +36,11 @@ jobs:
3736 - name : Upload snapshot artifact cryptomator-cli-${{ env.BUILD_VERSION }}.jar
3837 uses : actions/upload-artifact@v2
3938 with :
40- name : cryptomator-cli-${{ env.BUILD_VERSION }}.jar
39+ name : cryptomator-cli-${{ jobs.build. env.BUILD_VERSION }}.jar
4140 path : target/cryptomator-cli-*.jar
4241
4342 release :
44- name : Draft a Release on GitHub Releases
43+ name : Draft a Release on GitHub Releases and uploads the build artifacts to it
4544 runs-on : ubuntu-latest
4645 needs : build
4746 if : startsWith(github.ref, 'refs/tags/')
@@ -63,12 +62,12 @@ jobs:
6362 :construction: Work in Progress
6463 draft : true
6564 prerelease : false
66- - name : Upload cryptomator-cli.jar to GitHub Releases
65+ - name : Upload cryptomator-cli-${{ needs.build.outputs.artifact-version }} .jar to GitHub Releases
67666867 env :
6968 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7069 with :
7170 upload_url : ${{ steps.create_release.outputs.upload_url }}
72- asset_path : cryptomator-cli.jar
71+ asset_path : cryptomator-cli-${{ needs.build.outputs.artifact-version }} .jar
7372 asset_name : cryptomator-cli-${{ needs.build.outputs.artifact-version }}.jar
7473 asset_content_type : application/jar
0 commit comments