mirror of
https://github.com/ColdeZhang/Dominion.git
synced 2025-01-14 18:04:26 +08:00
52 lines
1.6 KiB
YAML
52 lines
1.6 KiB
YAML
name: Java CI-CD with Gradle
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: "Pull & Checkout"
|
|
uses: https://ssl.lunadeer.cn:14446/actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- name: "Set up JDK 17"
|
|
uses: https://ssl.lunadeer.cn:14446/actions/setup-java@v3
|
|
with:
|
|
java-version: '17'
|
|
distribution: 'zulu'
|
|
cache: gradle
|
|
- name: "Set up JDK 21"
|
|
uses: https://ssl.lunadeer.cn:14446/actions/setup-java@v3
|
|
with:
|
|
java-version: '21'
|
|
distribution: 'zulu'
|
|
cache: gradle
|
|
- name: "Build with Gradle"
|
|
run: |
|
|
./gradlew clean
|
|
./gradlew shadowJar -PBuildFull=false
|
|
./gradlew shadowJar -PBuildFull=true
|
|
- name: "Stage"
|
|
run: |
|
|
mkdir -p staging
|
|
mv build/libs/*.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:
|
|
note: " - `full` 后缀包含所有依赖直接安装即可使用,`lite` 后缀不包含任何依赖,会在第一次安装后启动时自动下载"
|
|
files: |-
|
|
staging/*.jar
|
|
api_key: '${{secrets.RELEASE_TOKEN}}' |