Skip to content

添加 bstats 隐私模式 #10

添加 bstats 隐私模式

添加 bstats 隐私模式 #10

name: Build and Release Bukkit Plugin
on:
push:
branches:
- master
paths:
- '.github/workflows/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '21'
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven
- name: Build with Maven
run: mvn clean install
release:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '21'
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven
- name: Build with Maven
run: mvn clean install
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# 发布新版本改这里
tag_name: v1.0.2
release_name: Release v1.0.2
draft: false
prerelease: false
- name: Upload Artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
# 发布新版本改这里
asset_path: target/WorldSafe-1.0.2.jar
asset_name: WorldSafe-1.0.2.jar
asset_content_type: application/java-archive