From a547034e761a9ef78626dfec5abc25266b652b5f Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Wed, 19 Oct 2022 18:28:31 -0700 Subject: [PATCH] ci: upload the artifacts to the release in a separate job --- .github/workflows/CI.yml | 44 ++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e9fee942..c5664e2c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -59,14 +59,45 @@ jobs: run: | pnpm install + # - name: Setup SSH debugging session + # uses: mxschmitt/action-tmate@v3 + + - name: Test + if: "!contains(github.event.head_commit.message, '[skip ci test]')" + run: | + pnpm run test + continue-on-error: ${{ contains(matrix.os, 'ubuntu-18.04') }} + # Create self-contained executable that bundles Nodejs - name: Create Executable if: "contains(matrix.os, 'windows-2022') || contains(matrix.os, 'ubuntu-22.04') || contains(matrix.os, 'macos-12')" run: | pnpm run pack.exe - # Draft the release - - if: ${{ (github.event_name == 'tag') && contains(matrix.os, 'windows-2022') || contains(matrix.os, 'ubuntu-22.04') || contains(matrix.os, 'macos-12') }} + - name: Upload Artifacts + if: ${{ (github.event_name == 'tag') && contains(matrix.os, 'windows-2022') || contains(matrix.os, 'ubuntu-22.04') || contains(matrix.os, 'macos-12') }} + uses: actions/upload-artifact@v3 + with: + path: | + ./exe + ./dist + retention-days: 1 + + Release: + needs: Test + if: ${{ (github.event_name == 'release') }} + runs-on: ubuntu-22.04 + steps: + - name: Download Artifacts + uses: actions/download-artifact@v3 + + - name: Place Artifacts + run: | + mv -v artifact/* ./ + mv -v artifact/.[^.]* ./ + chmod +x -R ./exe/ + + - name: Draft the release uses: meeDamian/github-release@2.0 with: token: ${{ secrets.GITHUB_TOKEN }} @@ -81,15 +112,6 @@ jobs: ./dist/node12/ ./dist/node16/ - # - name: Setup SSH debugging session - # uses: mxschmitt/action-tmate@v3 - - - name: Test - if: "!contains(github.event.head_commit.message, '[skip ci test]')" - run: | - pnpm run test - continue-on-error: ${{ contains(matrix.os, 'ubuntu-18.04') }} - Docker: if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip docker]') }} runs-on: ${{ matrix.os }}