LiteWorldEdit/.gitea/workflows/build.yml
2023-12-07 10:52:38 +08:00

38 lines
1.0 KiB
YAML

name: Java CI with Maven
# 检测到 src 文件内 .java 文件有变动执行编译
on:
push:
paths:
- '**/*src/**/*.java'
# pom.xml 文件有变动执行编译
- '**/pom.xml'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Maven
uses: stCarolas/setup-maven@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- run: mkdir staging && cp target/*.jar staging
- name: Set Release version env variable
run: |
echo "RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
- name: "Build & test"
run: |
echo "done!"
- name: "Release"
uses: https://gitea.com/actions/release-action@main
with:
files: |-
staging/*.jar
api_key: '${{secrets.RELEASE_TOKEN}}'