Skip to content

Commit 5aeff9b

Browse files
author
Armin Schrenk
committed
Updating github actions workflow "build":
* restrict env var BUILD_VERSION to job environment * update descriptions of steps * fix asset path for uploading release assets
1 parent da09939 commit 5aeff9b

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ name: Build
33
on:
44
[push]
55

6-
env:
7-
BUILD_VERSION: SNAPSHOT
8-
96
jobs:
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
@@ -26,7 +25,7 @@ jobs:
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
6766
uses: actions/[email protected]
6867
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

Comments
 (0)