release.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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: Set up JDK 1.8
  15. uses: actions/setup-java@v1
  16. with:
  17. java-version: 1.8
  18. - name: chmod -R 777 *
  19. run: chmod -R 777 *
  20. - name: Keys setup
  21. shell: bash
  22. run: |
  23. mkdir build-gpg-sign
  24. echo "$GPG_PRIVATE" > build-gpg-sign/keys.gpg
  25. echo "$GPG_PUBLIC_" > build-gpg-sign/keys.gpg.pub
  26. mkdir build-secret-keys
  27. echo "$SONATYPE_USER" > build-secret-keys/sonatype.key
  28. echo "$SONATYPE_KEY" >> build-secret-keys/sonatype.key
  29. env:
  30. GPG_PRIVATE: ${{ secrets.GPG_PRIVATE_KEY }}
  31. GPG_PUBLIC_: ${{ secrets.GPG_PUBLIC_KEY }}
  32. SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
  33. SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
  34. - name: Init gradle project
  35. run: ./gradlew clean --scan
  36. - name: Check keys
  37. run: ./gradlew ensureMavenCentralAvailable
  38. - name: fillBuildConstants
  39. run: >
  40. ./gradlew
  41. fillBuildConstants --scan
  42. - name: Assemble
  43. run: ./gradlew assemble --scan
  44. - name: Check
  45. run: >
  46. ./gradlew check --scan
  47. -Dmirai.network.show.all.components=true
  48. -Dkotlinx.coroutines.debug=on
  49. -Dmirai.network.show.packet.details=true
  50. - name: Gradle :mirai-core-utils:publish
  51. run: >
  52. ./gradlew :mirai-core-utils:publish --scan --scan
  53. - name: Gradle :mirai-core-api:publish
  54. run: >
  55. ./gradlew :mirai-core-api:publish --scan --scan
  56. - name: Gradle :mirai-core:publish
  57. run: >
  58. ./gradlew :mirai-core:publish --scan --scan
  59. - name: Gradle :mirai-core-all:publish
  60. run: >
  61. ./gradlew :mirai-core-all:publish --info --scan
  62. - name: Gradle :mirai-console:publish
  63. run: >
  64. ./gradlew
  65. :mirai-console:publish --info --scan
  66. - name: Gradle :mirai-console-terminal:publish
  67. run: >
  68. ./gradlew
  69. :mirai-console-terminal:publish --info --scan
  70. - name: Gradle :mirai-console-compiler-common:publish
  71. run: >
  72. ./gradlew
  73. :mirai-console-compiler-common:publish --info --scan
  74. - name: Gradle :mirai-console-compiler-annotations:publish
  75. run: >
  76. ./gradlew
  77. :mirai-console-compiler-annotations:publish --info --scan
  78. - name: Publish Gradle plugin
  79. run: >
  80. ./gradlew
  81. :mirai-console-gradle:publishPlugins --scan
  82. -Dgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }} -Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }}
  83. -Dgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }} -Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }}
  84. - name: Gradle :ci-release-helper:closeRepository
  85. run: >
  86. ./gradlew
  87. :ci-release-helper:closeRepository --info --scan