This repository has been archived by the owner on Feb 20, 2024. It is now read-only.
Release: v0.2.0 #5
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: Publish Release | |
on: | |
push: | |
tags: | |
- 'v**' | |
env: | |
IS_CI: true | |
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | |
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }} | |
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
GRADLE_OPTS: "-Xmx8g -Xms2g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8" | |
jobs: | |
run-test-and-publish: | |
name: Run test and publish | |
strategy: | |
matrix: | |
os: [ macos-latest, windows-latest, ubuntu-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
# 检出仓库代码 | |
- name: Check Out Repo | |
uses: actions/checkout@v3 | |
# setup Java | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 11 | |
cache: 'gradle' | |
- name: Gradle Run Test | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-version: 8.5 | |
# arguments: clean assemble test | |
arguments: assemble test -Porg.gradle.daemon=false | |
- name: Gradle Publish Release | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-version: 8.5 | |
arguments: | | |
publishToSonatype | |
closeAndReleaseStagingRepository | |
--info | |
--warning-mode all | |
-x test | |
--build-cache | |
-Porg.gradle.jvmargs="-Xmx8g -Xms2g -XX:MaxPermSize=1g -Dfile.encoding=UTF-8" | |
-Porg.gradle.daemon=false | |
env: | |
SIMBOT_IS_SNAPSHOT: false | |
SIMBOT_RELEASES_ONLY: true | |
create-release: | |
name: Create release | |
runs-on: ubuntu-latest | |
needs: run-test-and-publish | |
permissions: | |
contents: write | |
steps: | |
# 检出仓库代码 | |
- name: Check Out Repo | |
uses: actions/checkout@v3 | |
# Create gitHub release | |
- name: Create Github Release | |
uses: softprops/action-gh-release@v0.1.14 | |
with: | |
token: ${{ secrets.PUSH_TOKEN }} | |
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') }} | |
publish-snapshot: | |
name: Publish snapshot | |
runs-on: ubuntu-latest | |
needs: run-test-and-publish | |
steps: | |
# 检出仓库代码 | |
- name: Check out repo | |
uses: actions/checkout@v3 | |
# setup Java | |
- name: Setup java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 11 | |
# setup Gradle | |
- name: Gradle publish snapshot | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-version: 8.5 | |
arguments: clean test publishToSonatype closeAndReleaseStagingRepository | |
env: | |
SIMBOT_IS_SNAPSHOT: true | |
SIMBOT_SNAPSHOT_ONLY: true | |
deploy-doc: | |
name: Deploy-doc | |
runs-on: ubuntu-latest | |
needs: run-test-and-publish | |
steps: | |
# 检出仓库代码 | |
- name: Check out repo | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
# setup Java | |
- name: Setup java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 11 | |
# setup Gradle | |
- name: Gradle generate documentation | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-version: 8.5 | |
arguments: | | |
-Porg.gradle.jvmargs="-Xmx4g -Xms4g -XX:MaxMetaspaceSize=2g -Dfile.encoding=UTF-8" | |
-Porg.gradle.daemon=false | |
--info | |
--warning-mode all | |
-x test | |
--build-cache | |
dokkaHtmlMultiModule | |
- name: Push to doc repository | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
personal_token: ${{ secrets.PUSH_TOKEN }} | |
external_repository: simple-robot-library/simbot3-api-docs | |
publish_branch: kdoc-deploy/component-miyoushe-villa | |
publish_dir: ./build/dokka/html | |
# deploy to sub dir | |
destination_dir: components/miyoushe-villa | |
# deploy-website: | |
# name: Deploy Website | |
# runs-on: ubuntu-latest | |
# needs: run-test-and-publish | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - uses: actions/setup-node@v3 | |
# with: | |
# node-version: 16.x | |
# cache: npm | |
# cache-dependency-path: ./website/package-lock.json | |
# | |
# - run: | | |
# npm ci | |
# npm run build | |
# working-directory: ./website | |
# | |
# # https://github.com/marketplace/actions/github-pages-action | |
# - name: Push to doc repository | |
# uses: peaceiris/actions-gh-pages@v3 | |
# with: | |
# personal_token: ${{ secrets.PUSH_TOKEN }} | |
# publish_branch: gh-pages | |
# publish_dir: ./website/build |