From 1e0cbde5b1c2b01c56704d393e5783785310e314 Mon Sep 17 00:00:00 2001 From: akl7777777 <84266551+akl7777777@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:21:41 +0800 Subject: [PATCH] Update maven.yml --- .github/workflows/maven.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 53c3e71..0c56b27 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -29,12 +29,19 @@ jobs: - name: Build with Maven run: mvn clean package + - name: Find JAR file + id: find_jar + run: | + JAR_PATH=$(find target -name "*.jar" -not -name "*sources.jar" -not -name "*javadoc.jar" | head -n 1) + echo "JAR_PATH=$JAR_PATH" >> $GITHUB_OUTPUT + echo "Found JAR at $JAR_PATH" + - name: Upload JAR uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: ./target/ShellApiLogOptimizer-${{ github.ref_name }}.jar + asset_path: ${{ steps.find_jar.outputs.JAR_PATH }} asset_name: ShellApiLogOptimizer-${{ github.ref_name }}.jar asset_content_type: application/java-archive