mirror of
https://github.com/YuWanTingbb/unofficial-gpt4.git
synced 2025-10-16 23:14:06 +00:00
更新 maven-publish.yml
This commit is contained in:
64
.github/workflows/maven-publish.yml
vendored
64
.github/workflows/maven-publish.yml
vendored
@@ -1,46 +1,44 @@
|
|||||||
name: Java CI with Maven and GraalVM Native Image
|
namname: Build and Upload Spring Boot Native Image with Maven
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: windows-latest
|
runs-on: macos-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Set up GraalVM
|
- name: Set up JDK 17
|
||||||
|
uses: actions/setup-java@v2
|
||||||
|
with:
|
||||||
|
java-version: '17'
|
||||||
|
distribution: 'temurin'
|
||||||
|
|
||||||
|
- name: Cache Maven packages
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.m2
|
||||||
|
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
||||||
|
restore-keys: ${{ runner.os }}-m2
|
||||||
|
|
||||||
|
- name: Install GraalVM
|
||||||
uses: DeLaGuardo/setup-graalvm@5.0
|
uses: DeLaGuardo/setup-graalvm@5.0
|
||||||
with:
|
with:
|
||||||
graalvm-version: '21.0.2'
|
graalvm-version: '21.3.0' # Ensure this version is compatible with Java 17
|
||||||
java-version: 'java17'
|
java-version: '17'
|
||||||
|
|
||||||
# 打包应用程序
|
- name: Build native image with Maven
|
||||||
- name: Package Application
|
run: ./mvnw native:compile -Pnative
|
||||||
run: |
|
|
||||||
./mvnw native:compile -Pnative
|
|
||||||
|
|
||||||
# 创建并发布 Release
|
- name: Move binary to target folder
|
||||||
- name: Create and Publish a Release
|
run: mv ./gpt-4-copilot-0.0.4 ./target/gpt-4-copilot-0.0.4 Replace your-binary-name with the actual name of your binary file
|
||||||
id: create_release
|
|
||||||
uses: actions/create-release@v1
|
- name: Upload native image from target folder
|
||||||
env:
|
uses: actions/upload-artifact@v2
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ github.ref }}
|
name: native-image
|
||||||
release_name: Release ${{ github.ref }}
|
path: target/gpt-4-copilot-0.0.4
|
||||||
draft: false
|
|
||||||
prerelease: false
|
|
||||||
|
|
||||||
# 上传构建文件到 Release
|
|
||||||
- name: Upload Release Asset
|
|
||||||
uses: actions/upload-release-asset@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
asset_path: ./gpt-copilot-java
|
|
||||||
asset_name: gpt-copilot-java.exe
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user