Skip to content

Commit a547034

Browse files
committed
ci: upload the artifacts to the release in a separate job
1 parent 2944fdf commit a547034

File tree

1 file changed

+33
-11
lines changed

1 file changed

+33
-11
lines changed

.github/workflows/CI.yml

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,45 @@ jobs:
5959
run: |
6060
pnpm install
6161
62+
# - name: Setup SSH debugging session
63+
# uses: mxschmitt/action-tmate@v3
64+
65+
- name: Test
66+
if: "!contains(github.event.head_commit.message, '[skip ci test]')"
67+
run: |
68+
pnpm run test
69+
continue-on-error: ${{ contains(matrix.os, 'ubuntu-18.04') }}
70+
6271
# Create self-contained executable that bundles Nodejs
6372
- name: Create Executable
6473
if: "contains(matrix.os, 'windows-2022') || contains(matrix.os, 'ubuntu-22.04') || contains(matrix.os, 'macos-12')"
6574
run: |
6675
pnpm run pack.exe
6776
68-
# Draft the release
69-
- if: ${{ (github.event_name == 'tag') && contains(matrix.os, 'windows-2022') || contains(matrix.os, 'ubuntu-22.04') || contains(matrix.os, 'macos-12') }}
77+
- name: Upload Artifacts
78+
if: ${{ (github.event_name == 'tag') && contains(matrix.os, 'windows-2022') || contains(matrix.os, 'ubuntu-22.04') || contains(matrix.os, 'macos-12') }}
79+
uses: actions/upload-artifact@v3
80+
with:
81+
path: |
82+
./exe
83+
./dist
84+
retention-days: 1
85+
86+
Release:
87+
needs: Test
88+
if: ${{ (github.event_name == 'release') }}
89+
runs-on: ubuntu-22.04
90+
steps:
91+
- name: Download Artifacts
92+
uses: actions/download-artifact@v3
93+
94+
- name: Place Artifacts
95+
run: |
96+
mv -v artifact/* ./
97+
mv -v artifact/.[^.]* ./
98+
chmod +x -R ./exe/
99+
100+
- name: Draft the release
70101
uses: meeDamian/github-release@2.0
71102
with:
72103
token: ${{ secrets.GITHUB_TOKEN }}
@@ -81,15 +112,6 @@ jobs:
81112
./dist/node12/
82113
./dist/node16/
83114
84-
# - name: Setup SSH debugging session
85-
# uses: mxschmitt/action-tmate@v3
86-
87-
- name: Test
88-
if: "!contains(github.event.head_commit.message, '[skip ci test]')"
89-
run: |
90-
pnpm run test
91-
continue-on-error: ${{ contains(matrix.os, 'ubuntu-18.04') }}
92-
93115
Docker:
94116
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip docker]') }}
95117
runs-on: ${{ matrix.os }}

0 commit comments

Comments
 (0)