release: v2.1.0-0.10.0 #73
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build and publish release | |
on: | |
push: | |
tags: | |
- v** | |
# 手动触发工作流 | |
workflow_dispatch: | |
env: | |
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | |
GPG_SECRET_KEY: ${{ secrets.GPG_PRI_KEY }} | |
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} | |
OSSRH_USER: ${{ secrets.OSS_USERNAME }} | |
OSSRH_PASSWORD: ${{ secrets.OSS_PASSWORD }} | |
RELEASE: true | |
CI: true | |
IS_CI: true | |
SIMBOT_LOCAL: false | |
GRADLE_OPTS: "-Dfile.encoding=UTF-8" | |
jobs: | |
test: | |
name: Build test | |
strategy: | |
matrix: | |
os: [ macos-latest, windows-latest, ubuntu-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 11 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
gradle-version: 8.5 | |
- run: gradle assemble build -s | |
publish: | |
name: Publish | |
needs: test | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Setup java | |
# https://github.com/marketplace/actions/setup-java-jdk | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 11 | |
- name: Test and publish to sonatype | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
gradle-version: 8.5 | |
arguments: | |
publishToSonatype | |
closeAndReleaseStagingRepositories | |
-s | |
--warning-mode all | |
-x test | |
--build-cache | |
-Porg.gradle.jvmargs="-XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8" | |
-Porg.gradle.daemon=false | |
env: | |
PLUGIN_AUTO: true | |
publish-gradle-plugin: | |
name: Publish Gradle Plugin | |
runs-on: ubuntu-latest | |
needs: publish | |
steps: | |
# 检出仓库代码 | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
# Setup java | |
# https://github.com/marketplace/actions/setup-java-jdk | |
- name: Setup Java 11 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 11 | |
- name: Publish to gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
gradle-version: 8.5 | |
arguments: | | |
build | |
publishPlugins | |
-s | |
--warning-mode all | |
-x test | |
--build-cache | |
-Porg.gradle.jvmargs="-XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8" | |
-Porg.gradle.daemon=false | |
-Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }} | |
-Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }} | |
env: | |
PLUGIN_AUTO: true | |
create-release: | |
name: Create release | |
runs-on: ubuntu-latest | |
needs: [ publish, publish-gradle-plugin ] | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 11 | |
- name: Create changelog | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
gradle-version: 8.5 | |
arguments: createChangelog | |
# https://github.com/softprops/action-gh-release | |
# Create gitHub release | |
- name: Create Github Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
token: ${{ secrets.FORTE_TOKEN }} | |
draft: true | |
body_path: .changelog/${{ github.ref_name }}.md | |
generate_release_notes: true | |
prerelease: ${{ contains(github.ref_name, 'preview') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'alpha') }} |