Skip to content

Feature: Split CI builds into different workflows (#69) #87

Feature: Split CI builds into different workflows (#69)

Feature: Split CI builds into different workflows (#69) #87

Workflow file for this run

name: Build
on:
push:
pull_request_target:
types: [labeled]
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