测试CI-CD脚本
All checks were successful
Java CI with Maven / build (push) Successful in 32m55s

This commit is contained in:
zhangyuheng 2023-12-07 11:54:48 +08:00
parent 7a7a47e8de
commit 2536ca17e9

View File

@ -1,13 +1,9 @@
name: Java CI with Maven name: Java CI with Maven
# 检测到 src 文件内 .java 文件有变动执行编译
on: on:
push: push:
paths: tags:
- '**/*src/**/*.java' - '*'
# pom.xml 文件有变动执行编译
- '**/pom.xml'
- '**/.gitea/workflows/*.yml'
jobs: jobs:
build: build:
@ -29,9 +25,6 @@ jobs:
run: mvn -B package --file pom.xml run: mvn -B package --file pom.xml
- name: "Copy jar to staging" - name: "Copy jar to staging"
run: mkdir staging && cp target/*.jar 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" - name: "Build & test"
run: | run: |
echo "done!" echo "done!"
@ -44,6 +37,4 @@ jobs:
with: with:
files: |- files: |-
staging/*.jar staging/*.jar
title: "Release ${{ env.RELEASE_VERSION }}"
automatic_release_tag: "${{ env.RELEASE_VERSION }}"
api_key: '${{secrets.RELEASE_TOKEN}}' api_key: '${{secrets.RELEASE_TOKEN}}'