release-check.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. name: Release Check
  2. on:
  3. push:
  4. branches:
  5. - 'release/**'
  6. - 'hotfix/**'
  7. defaults:
  8. run:
  9. shell: bash
  10. env:
  11. JAVA_DIST: 'temurin'
  12. JAVA_VERSION: 23
  13. jobs:
  14. check-preconditions:
  15. name: Validate commits pushed to release/hotfix branch to fulfill release requirements
  16. runs-on: ubuntu-latest
  17. steps:
  18. - uses: actions/checkout@v4
  19. - name: Setup Java
  20. uses: actions/setup-java@v4
  21. with:
  22. distribution: ${{ env.JAVA_DIST }}
  23. java-version: ${{ env.JAVA_VERSION }}
  24. cache: 'maven'
  25. - id: validate-pom-version
  26. name: Validate POM version
  27. run: |
  28. if [[ $GITHUB_REF =~ refs/heads/(hotfix|release)/[0-9]+\.[0-9]+\.[0-9]+.* ]]; then
  29. SEM_VER_STR=${GITHUB_REF##*/}
  30. else
  31. echo "Failed to parse version"
  32. exit 1
  33. fi
  34. if [[ ${SEM_VER_STR} == `mvn help:evaluate -Dexpression=project.version -q -DforceStdout` ]]; then
  35. echo "semVerStr=${SEM_VER_STR}" >> $GITHUB_OUTPUT
  36. else
  37. echo "Version not set in POM"
  38. exit 1
  39. fi
  40. - name: Validate release in org.cryptomator.Cryptomator.metainfo.xml file
  41. run: |
  42. if ! grep -q "<release date=\".*\" version=\"${{ steps.validate-pom-version.outputs.semVerStr }}\">" dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml; then
  43. echo "Release not set in dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml"
  44. exit 1
  45. fi
  46. - name: Cache NVD DB
  47. uses: actions/cache@v4
  48. with:
  49. path: ~/.m2/repository/org/owasp/dependency-check-data/
  50. key: dependency-check-${{ github.run_id }}
  51. restore-keys: |
  52. dependency-check
  53. env:
  54. SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
  55. - name: Run org.owasp:dependency-check plugin
  56. id: dependency-check
  57. continue-on-error: true
  58. run: mvn -B verify -Pdependency-check -DskipTests -Djavafx.platform=linux
  59. env:
  60. NVD_API_KEY: ${{ secrets.NVD_API_KEY }}