Files
unofficial-gpt4/.github/workflows/maven-publish.yml
2024-02-23 00:18:03 +08:00

48 lines
1.2 KiB
YAML

name: Build and Upload Spring Boot Native Image with Maven
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- 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
with:
graalvm-version: '21.3.0' # Ensure this version is compatible with Java 17
java-version: '17'
- name: Set execute permissions for mvnw
run: chmod +x ./mvnw
- name: Build native image with Maven
run: ./mvnw native:compile -Pnative
- name: Move binary to target folder
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
- name: Upload native image from target folder
uses: actions/upload-artifact@v2
with:
name: native-image
path: target/gpt-4-copilot-0.0.4