build: 测试构建 v7
This commit is contained in:
parent
4b91763439
commit
a966e7c2f5
24
.github/workflows/build-and-release.yml
vendored
24
.github/workflows/build-and-release.yml
vendored
|
|
@ -29,11 +29,15 @@ jobs:
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
run: ./gradlew clean build
|
run: ./gradlew clean build
|
||||||
|
|
||||||
- name: Upload build artifacts
|
- name: Upload each jar separately
|
||||||
uses: actions/upload-artifact@v4
|
run: |
|
||||||
with:
|
for file in $(find . -name "*.jar" -path "*/build/libs/*"); do
|
||||||
name: my-build
|
echo "Uploading $file"
|
||||||
path: '**/build/libs/*.jar'
|
artifact_name=$(basename "$file" .jar)
|
||||||
|
gh release upload "${GITHUB_REF_NAME}" "$file" --repo "${GITHUB_REPOSITORY}" --clobber
|
||||||
|
done
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: build
|
needs: build
|
||||||
|
|
@ -57,9 +61,11 @@ jobs:
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Upload artifact to Release
|
- name: Upload jars to Release separately
|
||||||
uses: softprops/action-gh-release@v1
|
run: |
|
||||||
with:
|
for file in ./build-artifacts/**/*.jar; do
|
||||||
files: ./build-artifacts/**/*.jar
|
echo "Uploading $file"
|
||||||
|
gh release upload "${GITHUB_REF_NAME}" "$file" --repo "${GITHUB_REPOSITORY}" --clobber
|
||||||
|
done
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user