66 - main
77 tags :
88 - " v*"
9- pull_request :
10- # types: [closed]
11- branches :
12- - main
139
1410jobs :
1511 release :
1612 runs-on : ubuntu-latest
17- # if: ${{ github.event.pull_request.merged }}
1813 steps :
1914 - name : Checkout code
2015 uses : actions/checkout@v4
@@ -26,21 +21,21 @@ jobs:
2621 cache-dependency-path : ui/package-lock.json
2722
2823 - name : Build project
24+ id : build
2925 env :
3026 " NEXT_PUBLIC_DEV " : " false"
3127 run : |
28+ dist_file_suffix="${{ github.ref_type == 'tag' && github.ref_name || github.event.pull_request.head.sha || github.sha }}"
3229 mkdir -p releases/
3330 cur_dir="$(pwd)"
3431 cd ui/
3532 npm ci
3633 npm run build
3734 dist_dir="../nodes/web/static/"
38- if ! [ test -d "${dist_dir}" ];
39- then
40- dist_dir="./.next/";
41- fi
4235 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
4439 cd -
4540
4641 - name : Upload artifacts
@@ -49,21 +44,10 @@ jobs:
4944 name : release-artifacts
5045 path : releases/
5146
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-
5847 - name : Create release
59- if : ${{ steps.match-tag.outputs.match != ' ' }}
48+ if : ${{ github.ref_type == 'tag ' }}
6049 uses : softprops/action-gh-release@v2
6150 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
6953 generate_release_notes : true
0 commit comments