6
6
- main
7
7
tags :
8
8
- " v*"
9
- pull_request :
10
- # types: [closed]
11
- branches :
12
- - main
13
9
14
10
jobs :
15
11
release :
16
12
runs-on : ubuntu-latest
17
- # if: ${{ github.event.pull_request.merged }}
18
13
steps :
19
14
- name : Checkout code
20
15
uses : actions/checkout@v4
@@ -26,21 +21,21 @@ jobs:
26
21
cache-dependency-path : ui/package-lock.json
27
22
28
23
- name : Build project
24
+ id : build
29
25
env :
30
26
" NEXT_PUBLIC_DEV " : " false"
31
27
run : |
28
+ dist_file_suffix="${{ github.ref_type == 'tag' && github.ref_name || github.event.pull_request.head.sha || github.sha }}"
32
29
mkdir -p releases/
33
30
cur_dir="$(pwd)"
34
31
cd ui/
35
32
npm ci
36
33
npm run build
37
34
dist_dir="../nodes/web/static/"
38
- if ! [ test -d "${dist_dir}" ];
39
- then
40
- dist_dir="./.next/";
41
- fi
42
35
cd "$dist_dir"
43
- zip -DTr9q "${cur_dir}/releases/dist.zip" ./
36
+ dist_file_full="${cur_dir}/releases/comfystream-uikit-${dist_file_suffix}.zip"
37
+ zip -DTr9q "${dist_file_full}" ./
38
+ echo "dist_file=${dist_file_full}" >> $GITHUB_OUTPUT
44
39
cd -
45
40
46
41
- name : Upload artifacts
@@ -49,21 +44,10 @@ jobs:
49
44
name : release-artifacts
50
45
path : releases/
51
46
52
- - uses : actions-ecosystem/action-regex-match@v2
53
- id : match-tag
54
- with :
55
- text : ${{ github.event.workflow_run.head_branch }}
56
- regex : ' ^v([0-9]+\.\d+\.\d+)$'
57
-
58
47
- name : Create release
59
- if : ${{ steps.match-tag.outputs.match != ' ' }}
48
+ if : ${{ github.ref_type == 'tag ' }}
60
49
uses : softprops/action-gh-release@v2
61
50
with :
62
- files : |
63
- dist.zip
64
- tag_name : v${{ steps.current_version.outputs.version }}
65
- target_commitish : ${{ github.event.pull_request.base.ref }}
66
- make_latest : ${{ github.event.pull_request.base.ref == 'main' }}
67
- draft : true
68
- prerelease : false
51
+ files : ${{ steps.build.outputs.dist_file }}
52
+ make_latest : true
69
53
generate_release_notes : true
0 commit comments