name: Release Publish on: push: tags: - 'v*' # 正式版本 jobs: publish-mirai: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v2 - name: Checkout submodules run: git submodule update --init --recursive - name: Setup JDK 11 uses: actions/setup-java@v2 with: distribution: 'adopt' java-version: '11' - name: chmod -R 777 * run: chmod -R 777 * - name: Keys setup shell: bash run: | mkdir build-gpg-sign echo "$GPG_PRIVATE" > build-gpg-sign/keys.gpg echo "$GPG_PUBLIC_" > build-gpg-sign/keys.gpg.pub mkdir build-secret-keys echo "$SONATYPE_USER" > build-secret-keys/sonatype.key echo "$SONATYPE_KEY" >> build-secret-keys/sonatype.key env: GPG_PRIVATE: ${{ secrets.GPG_PRIVATE_KEY }} GPG_PUBLIC_: ${{ secrets.GPG_PUBLIC_KEY }} SONATYPE_USER: ${{ secrets.SONATYPE_USER }} SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }} - name: Init gradle project run: ./gradlew clean --scan - name: Check keys run: ./gradlew ensureMavenCentralAvailable - name: Assemble run: ./gradlew assemble --scan - name: Check run: > ./gradlew check --scan -Dmirai.network.show.all.components=true -Dkotlinx.coroutines.debug=on -Dmirai.network.show.packet.details=true - name: Ensure all compilations completed before publish run: > ./gradlew publishToMavenLocal --info --scan - name: Publish all artifacts run: > ./gradlew publish --no-parallel --info --scan - name: Publish Gradle plugin run: > ./gradlew :mirai-console-gradle:publishPlugins --scan -Dgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }} -Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }} -Dgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }} -Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }} - name: Gradle :ci-release-helper:closeRepository run: > ./gradlew :ci-release-helper:closeRepository --info --scan