mirror of
https://github.com/YuWanTingbb/unofficial-gpt4.git
synced 2025-10-14 14:11:23 +00:00
更新 maven-publish.yml
This commit is contained in:
67
.github/workflows/maven-publish.yml
vendored
67
.github/workflows/maven-publish.yml
vendored
@@ -5,49 +5,42 @@ on:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: SpringBootApp 在 ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '21'
|
||||
distribution: 'graalvm'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
native-image-job-reports: 'true'
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: 配置 Maven
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
- name: Cache Maven packages
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.os }}-m2
|
||||
|
||||
- name: Set execute permissions for mvnw
|
||||
run: chmod +x ./mvnw
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '21'
|
||||
distribution: 'graalvm'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
native-image-job-reports: 'true'
|
||||
|
||||
- name: Build native image with Maven
|
||||
run: ./mvnw native:compile -Pnative
|
||||
- name: Set execute permissions for mvnw
|
||||
run: chmod +x ./mvnw
|
||||
|
||||
- name: 将原生可执行文件重命名并移动到 target 目录
|
||||
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: Build native image with Maven
|
||||
run: ./mvnw native:compile -Pnative
|
||||
|
||||
- name: Upload native image from target folder
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: native-image
|
||||
path: target/gpt-4-copilot-0.4.0 # Replace your-binary-name with the actual name of your binary file
|
||||
|
||||
- name: 上传二进制文件
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: springbootapp-${{ matrix.os }}
|
||||
path: |
|
||||
target/${{ runner.os }}-application
|
||||
target/application.exe
|
||||
|
Reference in New Issue
Block a user