* 安全:强制用户配置可访问域名的白名单或者黑名单,提高安全性 * 安全:强制用户配置可访问域名的白名单或者黑名单,提高安全性 * CI:修复 CI 问题 * CI:修复 CI 问题
53 lines
1.4 KiB
Java
53 lines
1.4 KiB
Java
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
|
|
|
name: Java CI with Maven
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up JDK 21
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '21'
|
|
distribution: 'temurin' # 使用 Eclipse Temurin (AdoptOpenJDK 的继任者)
|
|
cache: 'maven'
|
|
|
|
- name: Cache Maven packages
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.m2/repository
|
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-maven-
|
|
|
|
- name: Build with Maven
|
|
run: mvn -B package -Dmaven.test.skip=true --file pom.xml
|
|
|
|
- name: Upload Linux distribution package
|
|
if: success()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: kkfileview-linux
|
|
path: server/target/*.tar.gz
|
|
retention-days: 7
|
|
|
|
- name: Upload Windows distribution package
|
|
if: success()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: kkfileview-windows
|
|
path: server/target/*.zip
|
|
retention-days: 7
|