Skip to content

v2.16.0

v2.16.0 #177

Workflow file for this run

name: Release Publish
on:
push:
tags:
- 'v*' # 正式版本
paths-ignore:
- 'docs/**'
- 'mirai-console/docs/**'
- '**/*.md'
jobs:
initialize-sonatype-stage:
name: "Initialize sonatype staging repository"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- run: chmod -R 777 *
- name: Create publishing staging repository
run: ./gradlew runcihelper --args create-stage-repo --scan "-Pcihelper.cert.username=${{ secrets.SONATYPE_USER }}" "-Pcihelper.cert.password=${{ secrets.SONATYPE_KEY }}" "-Pcihelper.cert.profileid=${{ secrets.SONATYPE_PROFILEID }}"
- name: Cache staging repository id
uses: actions/upload-artifact@v3
with:
name: publish-stage-id
path: ci-release-helper/repoid
publish-others:
name: "Others (${{ matrix.os }})"
runs-on: ${{ matrix.os }}
needs: [ initialize-sonatype-stage ]
strategy:
fail-fast: false
matrix:
os:
- macos-12
env:
# All targets MUST be enabled. See #2270.
gradleArgs: --scan "-Dmirai.target=other" "-Pkotlin.compiler.execution.strategy=in-process"
isMac: ${{ startsWith(matrix.os, 'macos') }}
isWindows: ${{ startsWith(matrix.os, 'windows') }}
isUbuntu: ${{ startsWith(matrix.os, 'ubuntu') }}
isUnix: ${{ startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') }}
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- 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
env:
GPG_PRIVATE: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PUBLIC_: ${{ secrets.GPG_PUBLIC_KEY }}
- name: Setup Android SDK Ubuntu
if: ${{ env.isUbuntu == 'true' }}
run: 'touch local.properties && echo sdk.dir=/usr/local/lib/android/sdk >> local.properties'
- name: Setup Android SDK macOS
if: ${{ env.isMac == 'true' }}
run: 'touch local.properties && echo sdk.dir=/Users/runner/Library/Android/sdk >> local.properties'
- name: Setup Android SDK Windows
if: ${{ env.isWindows == 'true' }}
run: 'echo sdk.dir=C:\Android\android-sdk >> local.properties'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Cache konan
uses: pat-s/[email protected]
with:
path: ~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- if: ${{ env.isUnix == 'true' }}
run: chmod -R 777 *
# Prepare environment for linking for macOS
- name: Clean and download dependencies
run: ./gradlew clean ${{ env.gradleArgs }}
- name: "Assemble"
run: ./gradlew assemble ${{ env.gradleArgs }}
- name: Publish Local Artifacts
if: ${{ env.enableLocalPublishingTest == 'true' }}
run: ./gradlew :mirai-deps-test:publishMiraiArtifactsToMavenLocal ${{ env.gradleArgs }} "-Dmirai.build.project.version=2.99.0-deps-test"
- name: "Check"
run: ./gradlew check ${{ env.gradleArgs }}
- if: ${{ env.isMac == 'true' }}
name: Ensure KDoc valid
run: ./gradlew dokkaHtmlMultiModule ${{ env.gradleArgs }}
- name: Initialize Publishing Caching Repository
run: ./gradlew runcihelper --args sync-maven-metadata ${{ env.gradleArgs }}
- name: Publish
if: ${{ env.isMac == 'true' }}
run: ./gradlew publishAllPublicationsToMiraiStageRepoRepository ${{ env.gradleArgs }}
- name: Restore staging repository id
uses: actions/download-artifact@v3
with:
name: publish-stage-id
path: ci-release-helper/repoid
- name: Release RAM
run: node ci-release-helper/scripts/kill-java.js
- name: Publish to maven central
run: ./gradlew runcihelper --args publish-to-maven-central --scan "-Pcihelper.cert.username=${{ secrets.SONATYPE_USER }}" "-Pcihelper.cert.password=${{ secrets.SONATYPE_KEY }}"
- name: Publish Gradle plugin
run: ./gradlew
:mirai-console-gradle:publishPlugins ${{ env.gradleArgs }}
-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 }}
continue-on-error: true
#
# close-repository:
# runs-on: macos-12
# needs:
# - publish-others
# - publish-core-native
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: 'recursive'
#
# - uses: actions/setup-java@v3
# with:
# distribution: 'adopt-openj9'
# java-version: '17'
#
# - name: Setup Gradle
# uses: gradle/gradle-build-action@v2
#
# - name: Close repository
# run: ./gradlew :ci-release-helper:closeRepository --scan