2024-02-20 23:27:40 +08:00
|
|
|
name: Java CI-CD with Maven
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- '*'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-04-28 17:38:07 +08:00
|
|
|
- name: "Pull & Checkout"
|
|
|
|
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: 'zulu'
|
|
|
|
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: "Build & test"
|
|
|
|
run: |
|
|
|
|
echo "done!"
|
|
|
|
- name: "setup go for release script"
|
|
|
|
run: |
|
|
|
|
wget --no-check-certificate https://golang.google.cn/dl/go1.21.6.linux-amd64.tar.gz
|
|
|
|
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.21.6.linux-amd64.tar.gz
|
|
|
|
ln -s /usr/local/go/bin/go /usr/bin/go
|
|
|
|
go version
|
|
|
|
- name: "Release"
|
|
|
|
uses: https://ssl.lunadeer.cn:14446/zhangyuheng/release-action@main
|
|
|
|
with:
|
2024-05-01 10:07:27 +08:00
|
|
|
note: "带 `original-` 前缀的文件无法用于运行,请下载不带此前缀的版本。"
|
2024-04-28 17:38:07 +08:00
|
|
|
files: |-
|
|
|
|
staging/*.jar
|
|
|
|
api_key: '${{secrets.RELEASE_TOKEN}}'
|