release.yml 3.5 KB

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