release.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # This is a basic workflow to help you get started with Actions
  2. name: Release Publish
  3. # Controls when the action will run. Triggers the workflow on push or pull request
  4. # events but only for the master branch
  5. on:
  6. release:
  7. types: [ created, prereleased ]
  8. push:
  9. tags:
  10. - '*-dev*'
  11. # A workflow run is made up of one or more jobs that can run sequentially or in parallel
  12. jobs:
  13. # This workflow contains a single job called "build"
  14. publish-mirai:
  15. runs-on: ubuntu-latest
  16. steps:
  17. - name: Checkout repository
  18. uses: actions/checkout@v2
  19. - name: Checkout submodules
  20. run: git submodule update --init --recursive --remote
  21. - name: Set up JDK 1.8
  22. uses: actions/setup-java@v1
  23. with:
  24. java-version: 1.8
  25. - name: chmod -R 777 *
  26. run: chmod -R 777 *
  27. - name: Init gradle project
  28. run: ./gradlew clean --info
  29. - name: Keys setup
  30. shell: bash
  31. run: |
  32. mkdir build-gpg-sign
  33. echo "$GPG_PRIVATE" > build-gpg-sign/keys.gpg
  34. echo "$GPG_PUBLIC_" > build-gpg-sign/keys.gpg.pub
  35. mkdir build-secret-keys
  36. echo "$SONATYPE_USER" > build-secret-keys/sonatype.key
  37. echo "$SONATYPE_KEY" >> build-secret-keys/sonatype.key
  38. echo "$BINTRAY_USER" > build-secret-keys/bintray.key
  39. echo "$BINTRAY_KEY" >> build-secret-keys/bintray.key
  40. env:
  41. GPG_PRIVATE: ${{ secrets.GPG_PRIVATE_KEY }}
  42. GPG_PUBLIC_: ${{ secrets.GPG_PUBLIC_KEY }}
  43. SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
  44. SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
  45. BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
  46. BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
  47. - name: Check keys
  48. run: >
  49. ./gradlew
  50. :mirai-core-utils:ensureBintrayAvailable
  51. :mirai-core-api:ensureBintrayAvailable
  52. :mirai-core:ensureBintrayAvailable
  53. :mirai-console:ensureBintrayAvailable
  54. :mirai-core-utils:ensureMavenCentralAvailable
  55. :mirai-core-api:ensureMavenCentralAvailable
  56. :mirai-core:ensureMavenCentralAvailable
  57. :mirai-console:ensureMavenCentralAvailable
  58. - name: fillBuildConstants
  59. run: >
  60. ./gradlew
  61. fillBuildConstants --info --stacktrace
  62. - name: Assemble
  63. run: ./gradlew assemble --info --stacktrace
  64. - name: Check
  65. run: ./gradlew check --info --stacktrace
  66. - name: Gradle :mirai-core-utils:publish
  67. run: >
  68. ./gradlew :mirai-core-utils:publish --info --stacktrace
  69. - name: Gradle :mirai-core-api:publish
  70. run: >
  71. ./gradlew :mirai-core-api:publish --info --stacktrace
  72. - name: Gradle :mirai-core:publish
  73. run: >
  74. ./gradlew :mirai-core:publish --info --stacktrace
  75. - name: Gradle :mirai-core-all:publish
  76. run: >
  77. ./gradlew :mirai-core-all:publish --info
  78. - name: Gradle :mirai-console:publish
  79. run: >
  80. ./gradlew
  81. :mirai-console:publish --info
  82. - name: Gradle :mirai-console-terminal:publish
  83. run: >
  84. ./gradlew
  85. :mirai-console-terminal:publish --info
  86. - name: Gradle :mirai-console-compiler-common:publish
  87. run: >
  88. ./gradlew
  89. :mirai-console-compiler-common:publish --info
  90. - name: Gradle :mirai-console-compiler-annotations:publish
  91. run: >
  92. ./gradlew
  93. :mirai-console-compiler-annotations:publish --info
  94. - name: Publish Gradle plugin
  95. run: >
  96. ./gradlew
  97. :mirai-console-gradle:publishPlugins --info --stacktrace
  98. -Dgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }} -Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }}
  99. -Dgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }} -Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }}