-
Notifications
You must be signed in to change notification settings - Fork 43
39 lines (37 loc) · 1.33 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Build
on:
[push]
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
outputs:
artifactVersion: ${{ steps.setversion.outputs.version }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '22'
distribution: 'temurin'
- name: Ensure to use tagged version
run: mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/} # use shell parameter expansion to strip of 'refs/tags'
if: startsWith(github.ref, 'refs/tags/')
- name: Output project version
id: setversion
run: |
BUILD_VERSION=$(mvn help:evaluate "-Dexpression=project.version" -q -DforceStdout)
echo "version=${BUILD_VERSION}" >> "$GITHUB_OUTPUT"
- name: Build and Test
run: mvn -B install
- name: Upload artifact cryptomator-cli-${{ steps.setversion.outputs.version }}.jar
uses: actions/upload-artifact@v4
with:
name: cryptomator-cli-${{ steps.setversion.outputs.version }}.jar
path: target/cryptomator-cli-*.jar
- name: Create release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }}
generate_release_notes: true
draft: true