Merge pull request #312 from cryptomator/feature/files-in-use #1099
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: | |
| push: | |
| pull_request_target: | |
| types: [labeled] | |
| env: | |
| JAVA_VERSION: 25 | |
| jobs: | |
| build: | |
| name: Build and Test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # Required for the attestations step | |
| attestations: write # Required for the attestations step | |
| contents: write # Required for the release step | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| show-progress: false | |
| - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 | |
| with: | |
| java-version: ${{ env.JAVA_VERSION }} | |
| distribution: 'temurin' | |
| cache: 'maven' | |
| - name: Cache SonarCloud packages | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| path: ~/.sonar/cache | |
| key: ${{ runner.os }}-sonar | |
| restore-keys: ${{ runner.os }}-sonar | |
| - name: Ensure to use tagged version | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: mvn -B versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/} | |
| - name: Build and Test | |
| run: > | |
| mvn -B verify | |
| jacoco:report | |
| org.sonarsource.scanner.maven:sonar-maven-plugin:sonar | |
| -Pcoverage | |
| -Dsonar.projectKey=cryptomator_cryptofs | |
| -Dsonar.organization=cryptomator | |
| -Dsonar.host.url=https://sonarcloud.io | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| - name: Attest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0 | |
| with: | |
| subject-path: | | |
| target/*.jar | |
| target/*.pom | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: artifacts | |
| path: target/*.jar | |
| - name: Create Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0 | |
| with: | |
| prerelease: true | |
| token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} | |
| generate_release_notes: true | |
| body: | | |
| For a list of all notable changes, read the [changelog](/CHANGELOG.md). |