LiteWorldEdit/.gitea/workflows/build.yml
zhangyuheng 4ce21637ca
Some checks failed
Java CI with Maven / build (push) Failing after 4m12s
测试CI-CD脚本
2023-12-07 11:22:53 +08:00

48 lines
1.5 KiB
YAML

name: Java CI with Maven
# 检测到 src 文件内 .java 文件有变动执行编译
on:
push:
paths:
- '**/*src/**/*.java'
# pom.xml 文件有变动执行编译
- '**/pom.xml'
- '**/.gitea/workflows/*.yml'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: https://ssl.lunadeer.cn:14446/actions/checkout@v3
with:
fetch-depth: 0
- name: "Set up Maven"
uses: https://ssl.lunadeer.cn:14446/actions/setup-maven@v4
- name: "Set up JDK 17"
uses: https://ssl.lunadeer.cn:14446/actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: "Build with Maven"
run: mvn -B package --file pom.xml
- name: "Copy jar to staging"
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: "setup go for release script"
uses: https://ssl.lunadeer.cn:14446/actions/setup-go@v4
with:
go-version: '>=1.20.1'
- name: "Release"
uses: https://ssl.lunadeer.cn:14446/actions/release-action@main
with:
files: |-
staging/*.jar
title: "Release ${{ env.RELEASE_VERSION }}"
automatic_release_tag: "${{ env.RELEASE_VERSION }}"
api_key: '${{secrets.RELEASE_TOKEN}}'