From ce7936ce1eb443187b4815a3412d4d299a089c0c Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Fri, 13 Sep 2024 16:20:52 +0200 Subject: [PATCH] update CI --- .github/workflows/build.yml | 56 ++++++++----------------------------- 1 file changed, 11 insertions(+), 45 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 27b3f3e..ef55216 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,21 +7,13 @@ jobs: build: name: Build and Test runs-on: ubuntu-latest - #This check is case insensitive - if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" outputs: artifactVersion: ${{ steps.setversion.outputs.version }} steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: - java-version: 17 - - uses: actions/cache@v1 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- + java-version: 22 - 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/') @@ -29,44 +21,18 @@ jobs: id: setversion run: | BUILD_VERSION=$(mvn help:evaluate "-Dexpression=project.version" -q -DforceStdout) - echo "::set-output name=version::${BUILD_VERSION}" + 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@v2 + uses: actions/upload-artifact@v4 with: name: cryptomator-cli-${{ steps.setversion.outputs.version }}.jar path: target/cryptomator-cli-*.jar - - release: - name: Draft a Release on GitHub Releases and uploads the build artifacts to it - runs-on: ubuntu-latest - needs: build - if: startsWith(github.ref, 'refs/tags/') - steps: - - name: Download cryptomator-cli.jar - uses: actions/download-artifact@v1 - with: - name: cryptomator-cli-${{ needs.build.outputs.artifactVersion }}.jar - path: . - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} - body: | - :construction: Work in Progress - draft: true - prerelease: false - - name: Upload cryptomator-cli-${{ needs.build.outputs.artifactVersion }}.jar to GitHub Releases - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v2 with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: cryptomator-cli-${{ needs.build.outputs.artifactVersion }}.jar - asset_name: cryptomator-cli-${{ needs.build.outputs.artifactVersion }}.jar - asset_content_type: application/jar + token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} + generate_release_notes: true + draft: true \ No newline at end of file