From e70c0b7b6fcb1e35e2c45edef4bce5e536422897 Mon Sep 17 00:00:00 2001 From: geekgeekrun Date: Fri, 12 Apr 2024 09:02:42 +0800 Subject: [PATCH] try to refactor the release ui ci - build and upload artifact for separate platform, then upload all artifact in a new job used for release. --- .github/workflows/release-ui.yml | 75 ++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 24 deletions(-) diff --git a/.github/workflows/release-ui.yml b/.github/workflows/release-ui.yml index 509a95f..18818f3 100644 --- a/.github/workflows/release-ui.yml +++ b/.github/workflows/release-ui.yml @@ -29,15 +29,14 @@ jobs: run: | cd packages/ui node ./scripts/github-ci-build.mjs - - - name: Create Release - uses: ncipollo/release-action@v1 + + - name: Upload + uses: actions/upload-artifact@v4 with: - allowUpdates: true - artifacts: "${{ github.workspace }}/packages/ui/dist/*.exe" - tag: ${{ github.ref }} - token: ${{ secrets.GITHUB_TOKEN }} - body: TODO New Release. + name: binary-geekgeekrun-ui-windows-${{ github.sha }} + path: | + ${{ github.workspace }}/packages/ui/dist/*.exe + overwrite: true build_on_macos: env: @@ -61,15 +60,15 @@ jobs: run: | cd packages/ui node ./scripts/github-ci-build.mjs - - - name: Create Release - uses: ncipollo/release-action@v1 + + - name: Upload + uses: actions/upload-artifact@v4 with: - allowUpdates: true - artifacts: "${{ github.workspace }}/packages/ui/dist/*.dmg,${{ github.workspace }}/packages/ui/dist/*.zip" - tag: ${{ github.ref }} - token: ${{ secrets.GITHUB_TOKEN }} - body: TODO New Release. + name: binary-geekgeekrun-ui-macos-${{ github.sha }} + path: | + ${{ github.workspace }}/packages/ui/dist/*.zip + ${{ github.workspace }}/packages/ui/dist/*.dmg + overwrite: true build_on_linux: env: @@ -93,12 +92,40 @@ jobs: run: | cd packages/ui node ./scripts/github-ci-build.mjs - - - name: Create Release - uses: ncipollo/release-action@v1 + + - name: Upload Artifact + uses: actions/upload-artifact@v4 with: - allowUpdates: true - artifacts: "${{ github.workspace }}/packages/ui/dist/*.deb,${{ github.workspace }}/packages/ui/dist/*.rpm" - tag: ${{ github.ref }} - token: ${{ secrets.GITHUB_TOKEN }} - body: TODO New Release. + name: binary-geekgeekrun-ui-linux-${{ github.sha }} + path: | + ${{ github.workspace }}/packages/ui/dist/*.deb + ${{ github.workspace }}/packages/ui/dist/*.rpm + overwrite: true + + release: + runs-on: ubuntu-latest + permissions: write-all + needs: + - build_on_linux + - build_on_macos + - build_on_windows + + steps: + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + path: geekgeekrun-ui@${{ github.sha }} + pattern: binary-geekgeekrun-ui-* + merge-multiple: true + + - name: Display structure of downloaded files + run: ls -llR geekgeekrun-ui@${{ github.sha }} + + - name: Create Release + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + artifacts: geekgeekrun-ui@${{ github.sha }}/* + tag: ${{ github.ref }} + token: ${{ secrets.GITHUB_TOKEN }} + body: TODO New Release.