mirror of
https://github.com/YuWanTingbb/unofficial-gpt4.git
synced 2025-10-15 14:41:00 +00:00
更新 maven-publish.yml
This commit is contained in:
24
.github/workflows/maven-publish.yml
vendored
24
.github/workflows/maven-publish.yml
vendored
@@ -28,7 +28,6 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
|
||||||
- name: Set up JDK 17
|
- name: Set up JDK 17
|
||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
@@ -55,7 +54,22 @@ jobs:
|
|||||||
- name: Build native image with Maven
|
- name: Build native image with Maven
|
||||||
run: ./mvnw native:compile -Pnative
|
run: ./mvnw native:compile -Pnative
|
||||||
|
|
||||||
- name: Create Release
|
- name: Check if release exists
|
||||||
|
id: check_release
|
||||||
|
run: |
|
||||||
|
RELEASE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||||
|
https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ steps.tag_name.outputs.tag }}) || true
|
||||||
|
if echo "$RELEASE" | grep -q '"id":'; then
|
||||||
|
echo "::set-output name=exists::true"
|
||||||
|
UPLOAD_URL=$(echo "$RELEASE" | jq -r .upload_url)
|
||||||
|
echo "::set-output name=upload_url::${UPLOAD_URL}"
|
||||||
|
else
|
||||||
|
echo "::set-output name=exists::false"
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Create Release if not exists
|
||||||
|
if: steps.check_release.outputs.exists == 'false'
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: actions/create-release@v1
|
uses: actions/create-release@v1
|
||||||
env:
|
env:
|
||||||
@@ -71,7 +85,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
upload_url: ${{ steps.check_release.outputs.exists == 'true' && steps.check_release.outputs.upload_url || steps.create_release.outputs.upload_url }}
|
||||||
asset_path: /target/gpt-4-copilot # Make sure this is the correct path to your built artifact
|
asset_path: ./target/gpt-4-copilot # 更新为您的构建产物路径
|
||||||
asset_name: gpt-4-copilot-${{ steps.tag_name.outputs.tag }}-${{ matrix.os }} # Make sure this is the correct name of your built artifact
|
asset_name: gpt-4-copilot-${{ steps.tag_name.outputs.tag }}-${{ matrix.os }}.tar.gz # 确保这是您构建产物的正确名称
|
||||||
asset_content_type: application/octet-stream
|
asset_content_type: application/octet-stream
|
||||||
|
Reference in New Issue
Block a user