From a4713c5d73cbf18963a8b4dddfe0a27d77980fc1 Mon Sep 17 00:00:00 2001 From: Yang Yang <153794571+YuWanTingbb@users.noreply.github.com> Date: Fri, 23 Feb 2024 02:32:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20maven-publish.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maven-publish.yml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index fc7af70..50f42a3 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -1,13 +1,21 @@ name: Build and Upload Spring Boot Native Image with Maven on: - push: - branches: - - main + release: + types: [created] + workflow_dispatch: + inputs: + tag: + description: 'Tag Name' + required: true jobs: build: - runs-on: macos-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest, windows-latest, ubuntu-latest] + arch: [amd64, arm64] steps: - uses: actions/checkout@v2 @@ -16,6 +24,7 @@ jobs: with: java-version: '17' distribution: 'temurin' + architecture: ${{ matrix.arch }} - name: Cache Maven packages uses: actions/cache@v2 @@ -43,8 +52,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ github.run_number }} - release_name: Release ${{ github.run_number }} + tag_name: ${{ steps.tag_name.outputs.tag }} + release_name: Release ${{ steps.tag_name.outputs.tag }} draft: false prerelease: false @@ -54,6 +63,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: 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_name: gpt-4-copilot # Make sure this is the correct name of your built artifact + asset_path: ./target/gpt-4-copilot # Make sure this is the correct path to your built artifact + asset_name: gpt-4-copilot-0.4.0-${{ matrix.os }}-${{ matrix.arch }} # Make sure this is the correct name of your built artifact asset_content_type: application/octet-stream