build: 测试构建 v8
This commit is contained in:
parent
a966e7c2f5
commit
c14d77400d
36
.github/workflows/build-and-release.yml
vendored
36
.github/workflows/build-and-release.yml
vendored
|
|
@ -29,27 +29,38 @@ jobs:
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
run: ./gradlew clean build
|
run: ./gradlew clean build
|
||||||
|
|
||||||
- name: Upload each jar separately
|
- name: Upload common jar
|
||||||
run: |
|
uses: actions/upload-artifact@v4
|
||||||
for file in $(find . -name "*.jar" -path "*/build/libs/*"); do
|
with:
|
||||||
echo "Uploading $file"
|
name: Common
|
||||||
artifact_name=$(basename "$file" .jar)
|
path: Common/build/libs/*.jar
|
||||||
gh release upload "${GITHUB_REF_NAME}" "$file" --repo "${GITHUB_REPOSITORY}" --clobber
|
|
||||||
done
|
- name: Upload common api jar
|
||||||
env:
|
uses: actions/upload-artifact@v4
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
with:
|
||||||
|
name: CommonApi
|
||||||
|
path: CommonApi/build/libs/*.jar
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: startsWith(github.ref, 'refs/tags/build-') # 只有打 tag 才执行 release
|
if: startsWith(github.ref, 'refs/tags/build-') # 只有打 tag 才执行 release
|
||||||
steps:
|
steps:
|
||||||
- name: Download build artifact
|
# 下载 Common JAR
|
||||||
|
- name: Download Common artifact
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: my-build
|
name: Common
|
||||||
path: ./build-artifacts
|
path: ./build-artifacts/Common
|
||||||
|
|
||||||
|
# 下载 CommonApi JAR
|
||||||
|
- name: Download CommonApi artifact
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: CommonApi
|
||||||
|
path: ./build-artifacts/CommonApi
|
||||||
|
|
||||||
|
# 创建 Release
|
||||||
- name: Create GitHub Release
|
- name: Create GitHub Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
|
@ -61,6 +72,7 @@ jobs:
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
# 上传各子项目 JAR 到 Release
|
||||||
- name: Upload jars to Release separately
|
- name: Upload jars to Release separately
|
||||||
run: |
|
run: |
|
||||||
for file in ./build-artifacts/**/*.jar; do
|
for file in ./build-artifacts/**/*.jar; do
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user