MapManager-Core 3.1.7 #14
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: release | |
on: | |
release: | |
branches: | |
- main | |
jobs: | |
build-and-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 检出代码 | |
uses: actions/checkout@v3 | |
- name: 设置 JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: 'gradle' | |
- name: 为 Gradlew 赋予执行权限 | |
run: chmod +x ./gradlew | |
- name: 使用 Gradle 构建 | |
run: ./gradlew build | |
- name: 列出 MapManager-Core 构建产物 | |
run: ls -lah ./MapManager-Core/build/libs/ | |
- name: 上传 Core 构件至 GitHub Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./MapManager-Core/build/libs/MapManager-Core-${{ github.event.release.tag_name }}.jar | |
asset_name: MapManager-Core-${{ github.event.release.tag_name }}.jar | |
asset_content_type: application/java-archive | |
generate-and-upload-javadoc: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 检出代码 | |
uses: actions/checkout@v3 | |
- name: 设置 JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: 'adopt' | |
cache: 'gradle' | |
- name: 生成 Dokka Javadoc | |
run: ./gradlew dokkaJavadoc | |
- name: 归档 Dokka Javadoc | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dokka-javadoc | |
path: ./MapManager-API/build/dokka/javadoc | |
- name: 上传到腾讯云COS并刷新CDN | |
env: | |
SECRET_ID: ${{ secrets.TCLOUD_API_ID }} | |
SECRET_KEY: ${{ secrets.TCLOUD_API_KEY }} | |
BUCKET: webapp-1318358151 | |
REGION: ap-shanghai | |
run: | | |
sudo pip install coscmd tccli | |
coscmd config -a $SECRET_ID -s $SECRET_KEY -b $BUCKET -r $REGION | |
tccli configure set secretId $SECRET_ID secretKey $SECRET_KEY region $REGION | |
coscmd upload -rfs --delete ./MapManager-API/build/dokka/javadoc /javadoc | |
tccli cdn PurgePathCache --cli-unfold-argument --Paths https://www.alsace.team/javadoc/ --FlushType flush |