LiteWorldEdit/.gitea/workflows/build.yml

46 lines
1.3 KiB
YAML
Raw Normal View History

name: Java CI with Maven
# 检测到 src 文件内 .java 文件有变动执行编译
on:
push:
paths:
- '**/*src/**/*.java'
2023-12-05 13:41:25 +08:00
# pom.xml 文件有变动执行编译
- '**/pom.xml'
2023-12-07 10:57:50 +08:00
- '**/.gitea/workflows/*.yml'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
2023-12-07 10:57:50 +08:00
- name: "Set up Maven"
2023-12-05 13:41:25 +08:00
uses: stCarolas/setup-maven@v4
2023-12-07 10:57:50 +08:00
- name: "Set up JDK 17"
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
2023-12-07 10:57:50 +08:00
- name: "Build with Maven"
run: mvn -B package --file pom.xml
2023-12-07 11:06:51 +08:00
- name: "Copy jar to staging"
run: mkdir staging && cp target/*.jar staging
2023-12-07 10:57:50 +08:00
- 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!"
2023-12-07 11:06:51 +08:00
- name: "setup go for release script"
uses: https://github.com/actions/setup-go@v4
with:
go-version: '>=1.20.1'
2023-12-07 10:52:38 +08:00
- name: "Release"
uses: https://gitea.com/actions/release-action@main
with:
2023-12-07 10:52:38 +08:00
files: |-
staging/*.jar
2023-12-07 10:57:50 +08:00
title: "Release ${{ env.RELEASE_VERSION }}"
automatic_release_tag: "${{ env.RELEASE_VERSION }}"
2023-12-07 10:52:38 +08:00
api_key: '${{secrets.RELEASE_TOKEN}}'