mirror of
https://github.com/YuWanTingbb/unofficial-gpt4.git
synced 2025-10-15 14:41:00 +00:00
Update maven-publish.yml
This commit is contained in:
67
.github/workflows/maven-publish.yml
vendored
67
.github/workflows/maven-publish.yml
vendored
@@ -5,43 +5,46 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: macos-latest
|
name: SpringBootApp 在 ${{ matrix.os }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up JDK 17
|
- uses: graalvm/setup-graalvm@v1
|
||||||
uses: actions/setup-java@v2
|
with:
|
||||||
with:
|
java-version: '21'
|
||||||
java-version: '17'
|
distribution: 'graalvm'
|
||||||
distribution: 'temurin'
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
native-image-job-reports: 'true'
|
||||||
|
|
||||||
- name: Cache Maven packages
|
- name: 配置 Maven
|
||||||
uses: actions/cache@v2
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
path: ~/.m2
|
distribution: 'temurin'
|
||||||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
java-version: '17'
|
||||||
restore-keys: ${{ runner.os }}-m2
|
|
||||||
|
|
||||||
- name: Install GraalVM compatible with Java 17
|
- name: 使用 Maven 构建原生镜像
|
||||||
uses: DeLaGuardo/setup-graalvm@5.0
|
run: mvn -Pnative -DskipTests package
|
||||||
with:
|
|
||||||
graalvm-version: '21.3.0' # Make sure this version is compatible with Java 17
|
|
||||||
java-version: '17'
|
|
||||||
|
|
||||||
- name: Install native-image component
|
- name: 将原生可执行文件重命名并移动到 target 目录
|
||||||
run: gu install native-image
|
run: |
|
||||||
|
mv target/*-runner target/${{ runner.os }}-application # 根据您的 Spring Boot Maven 输出目录和可执行文件名称调整此行。
|
||||||
|
if: ${{ matrix.os != 'windows-latest' }}
|
||||||
|
|
||||||
|
- name: 将原生可执行文件重命名并移动到 target 目录 (Windows)
|
||||||
|
run: |
|
||||||
|
mv target\*-runner.exe target\application.exe
|
||||||
|
if: ${{ matrix.os == 'windows-latest' }}
|
||||||
|
|
||||||
- name: Set execute permissions for mvnw
|
- name: 上传二进制文件
|
||||||
run: chmod +x ./mvnw
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
- name: Build native image with Maven
|
name: springbootapp-${{ matrix.os }}
|
||||||
run: ./mvnw native:compile -Pnative
|
path: |
|
||||||
|
target/${{ runner.os }}-application
|
||||||
- name: Upload native image from target folder
|
target/application.exe
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: native-image
|
|
||||||
path: target/gpt-4-copilot-0.0.4
|
|
||||||
|
Reference in New Issue
Block a user