release.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. name: Release Publish
  2. on:
  3. push:
  4. tags:
  5. - 'v*' # 正式版本
  6. jobs:
  7. publish-mirai:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: Checkout repository
  11. uses: actions/checkout@v2
  12. - name: Checkout submodules
  13. run: git submodule update --init --recursive
  14. - name: Setup JDK 11
  15. uses: actions/setup-java@v2
  16. with:
  17. distribution: 'adopt'
  18. java-version: '11'
  19. - name: chmod -R 777 *
  20. run: chmod -R 777 *
  21. - name: Keys setup
  22. shell: bash
  23. run: |
  24. mkdir build-gpg-sign
  25. echo "$GPG_PRIVATE" > build-gpg-sign/keys.gpg
  26. echo "$GPG_PUBLIC_" > build-gpg-sign/keys.gpg.pub
  27. mkdir build-secret-keys
  28. echo "$SONATYPE_USER" > build-secret-keys/sonatype.key
  29. echo "$SONATYPE_KEY" >> build-secret-keys/sonatype.key
  30. env:
  31. GPG_PRIVATE: ${{ secrets.GPG_PRIVATE_KEY }}
  32. GPG_PUBLIC_: ${{ secrets.GPG_PUBLIC_KEY }}
  33. SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
  34. SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
  35. - name: Init gradle project
  36. run: ./gradlew clean --scan
  37. - name: Check keys
  38. run: ./gradlew ensureMavenCentralAvailable
  39. - name: fillBuildConstants
  40. run: >
  41. ./gradlew
  42. fillBuildConstants --scan
  43. - name: Assemble
  44. run: ./gradlew assemble --scan
  45. - name: Check
  46. run: >
  47. ./gradlew check --scan
  48. -Dmirai.network.show.all.components=true
  49. -Dkotlinx.coroutines.debug=on
  50. -Dmirai.network.show.packet.details=true
  51. - name: Ensure all compilations completed before publish
  52. run: >
  53. ./gradlew publishToMavenLocal --info --scan
  54. - name: Publish all artifacts
  55. run: >
  56. ./gradlew publish --no-parallel --info --scan
  57. - name: Publish Gradle plugin
  58. run: >
  59. ./gradlew
  60. :mirai-console-gradle:publishPlugins --scan
  61. -Dgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }} -Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }}
  62. -Dgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }} -Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }}
  63. - name: Gradle :ci-release-helper:closeRepository
  64. run: >
  65. ./gradlew
  66. :ci-release-helper:closeRepository --info --scan