2023-12-05 11:52:24 +08:00
|
|
|
name: Java CI with Maven
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-12-07 11:54:48 +08:00
|
|
|
tags:
|
|
|
|
- '*'
|
2023-12-05 11:52:24 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-12-07 11:29:04 +08:00
|
|
|
- name: "Pull & Checkout"
|
|
|
|
uses: https://ssl.lunadeer.cn:14446/actions/checkout@v3
|
2023-12-07 11:09:35 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-12-07 10:57:50 +08:00
|
|
|
- name: "Set up Maven"
|
2023-12-07 11:22:53 +08:00
|
|
|
uses: https://ssl.lunadeer.cn:14446/actions/setup-maven@v4
|
2023-12-07 10:57:50 +08:00
|
|
|
- name: "Set up JDK 17"
|
2023-12-07 11:22:53 +08:00
|
|
|
uses: https://ssl.lunadeer.cn:14446/actions/setup-java@v3
|
2023-12-05 11:52:24 +08:00
|
|
|
with:
|
|
|
|
java-version: '17'
|
2023-12-07 11:29:04 +08:00
|
|
|
distribution: 'zulu'
|
2023-12-05 11:52:24 +08:00
|
|
|
cache: maven
|
2023-12-07 10:57:50 +08:00
|
|
|
- name: "Build with Maven"
|
2023-12-05 11:52:24 +08:00
|
|
|
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-05 11:52:24 +08:00
|
|
|
- name: "Build & test"
|
|
|
|
run: |
|
|
|
|
echo "done!"
|
2023-12-07 11:06:51 +08:00
|
|
|
- name: "setup go for release script"
|
2024-01-16 16:45:31 +08:00
|
|
|
run: apt-get update && apt-get install -y golang
|
2023-12-07 10:52:38 +08:00
|
|
|
- name: "Release"
|
2023-12-07 11:22:53 +08:00
|
|
|
uses: https://ssl.lunadeer.cn:14446/actions/release-action@main
|
2023-12-05 11:52:24 +08:00
|
|
|
with:
|
2023-12-07 10:52:38 +08:00
|
|
|
files: |-
|
2023-12-05 11:52:24 +08:00
|
|
|
staging/*.jar
|
2023-12-07 10:52:38 +08:00
|
|
|
api_key: '${{secrets.RELEASE_TOKEN}}'
|