build.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. name: Build
  2. on:
  3. push:
  4. pull_request_target:
  5. types: [labeled]
  6. env:
  7. JAVA_VERSION: 20
  8. defaults:
  9. run:
  10. shell: bash
  11. jobs:
  12. test:
  13. name: Compile and Test
  14. runs-on: ubuntu-latest
  15. steps:
  16. - uses: actions/checkout@v3
  17. - uses: actions/setup-java@v3
  18. with:
  19. distribution: 'zulu'
  20. java-version: ${{ env.JAVA_VERSION }}
  21. cache: 'maven'
  22. - name: Cache SonarCloud packages
  23. uses: actions/cache@v3
  24. with:
  25. path: ~/.sonar/cache
  26. key: ${{ runner.os }}-sonar
  27. restore-keys: ${{ runner.os }}-sonar
  28. - name: Build and Test
  29. run: >
  30. xvfb-run
  31. mvn -B verify
  32. jacoco:report
  33. org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
  34. -Pcoverage,dependency-check
  35. -Dsonar.projectKey=cryptomator_cryptomator
  36. -Dsonar.organization=cryptomator
  37. -Dsonar.host.url=https://sonarcloud.io
  38. env:
  39. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
  40. SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
  41. - name: Draft a release
  42. if: startsWith(github.ref, 'refs/tags/')
  43. uses: softprops/action-gh-release@v1
  44. with:
  45. draft: true
  46. discussion_category_name: releases
  47. token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }}
  48. generate_release_notes: true
  49. body: |-
  50. :construction: Work in Progress
  51. Please be patient, the builds are still running. We will publish new versions of Cryptomator here in a few moments.
  52. As usual, the GPG signatures can be checked using [our public key `5811 7AFA 1F85 B3EE C154 677D 615D 449F E6E6 A235`](https://gist.github.com/cryptobot/211111cf092037490275f39d408f461a).
  53. ---
  54. <!-- Don't forget to include the 💾 SHA-256 checksums of release artifacts: -->