diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 427f4ed..164235c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -32,12 +32,18 @@ jobs: export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 yes | sdk/cmdline-tools/bin/sdkmanager --sdk_root=`pwd`/sdk --licenses ./gradlew assembleRelease - cp app/build/outputs/apk/release/hev.sockstun-*-release.apk hev.sockstun-${{ github.ref_name }}-release.apk + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + file_name="pr-${{ github.event.pull_request.number }}" + else + file_name="${{ github.ref_name }}" + fi + echo "file_name=${file_name}" >> $GITHUB_ENV + cp app/build/outputs/apk/release/hev.sockstun-*-release.apk hev.sockstun-${file_name}-release.apk - name: Upload uses: actions/upload-artifact@v4 with: - name: hev.sockstun-${{ github.ref_name }}-release.apk - path: hev.sockstun-${{ github.ref_name }}-release.apk + name: hev.sockstun-${{ env.file_name }}-release.apk + path: hev.sockstun-${{ env.file_name }}-release.apk if-no-files-found: error retention-days: 1