From 2637baffc74c3af1351cb684fe81c39f51998415 Mon Sep 17 00:00:00 2001 From: catloversg <152669316+catloversg@users.noreply.github.com> Date: Sun, 7 Sep 2025 01:41:39 +0700 Subject: [PATCH] CD: Split build-artifacts.yml into 2 workflows (#2309) --- .github/workflows/build-artifacts.yml | 29 +------------- .github/workflows/build-upload-artifacts.yml | 40 ++++++++++++++++++++ 2 files changed, 42 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/build-upload-artifacts.yml diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 772ce81d6..81ca72a92 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -1,8 +1,8 @@ name: Build artifacts on: - release: - types: [published] + workflow_dispatch: + workflow_call: env: GH_TOKEN: ${{ github.token }} @@ -88,28 +88,3 @@ jobs: include-hidden-files: true path: .build/*.zip if-no-files-found: error - - upload: - name: Upload - runs-on: ubuntu-latest - needs: [build-windows, build-linux, build-mac] - steps: - - uses: actions/checkout@v4 - - name: Use Node.js 20 - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: "npm" - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - path: .build - pattern: build-artifacts-* - merge-multiple: true - - name: List files - run: ls -la .build - - name: Upload to release - env: - GH_REF_NAME: ${{ github.ref_name }} - run: | - for i in .build/*.zip; do gh release upload "$GH_REF_NAME" "$i" --clobber; done; diff --git a/.github/workflows/build-upload-artifacts.yml b/.github/workflows/build-upload-artifacts.yml new file mode 100644 index 000000000..36ba6f6ef --- /dev/null +++ b/.github/workflows/build-upload-artifacts.yml @@ -0,0 +1,40 @@ +name: Build and upload artifacts + +on: + release: + types: [published] + +env: + GH_TOKEN: ${{ github.token }} + +jobs: + build: + name: Build artifacts + uses: ./.github/workflows/build-artifacts.yml + + upload: + name: Upload + runs-on: ubuntu-latest + permissions: + contents: write + needs: [build] + steps: + - uses: actions/checkout@v4 + - name: Use Node.js 20 + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "npm" + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + path: .build + pattern: build-artifacts-* + merge-multiple: true + - name: List files + run: ls -la .build + - name: Upload to release + env: + GH_REF_NAME: ${{ github.ref_name }} + run: | + for i in .build/*.zip; do gh release upload "$GH_REF_NAME" "$i" --clobber; done;