[pull] main from Comfy-Org:main #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Release Draft Create | |
| on: | |
| pull_request: | |
| types: ['closed'] | |
| branches: [main, core/*] | |
| paths: | |
| - 'package.json' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| if: > | |
| github.event.pull_request.merged == true && | |
| contains(github.event.pull_request.labels.*.name, 'Release') | |
| outputs: | |
| version: ${{ steps.current_version.outputs.version }} | |
| is_prerelease: ${{ steps.check_prerelease.outputs.is_prerelease }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'pnpm' | |
| - name: Get current version | |
| id: current_version | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Check if prerelease | |
| id: check_prerelease | |
| run: | | |
| VERSION=${{ steps.current_version.outputs.version }} | |
| if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+- ]]; then | |
| echo "is_prerelease=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "is_prerelease=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Build project | |
| env: | |
| SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | |
| ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} | |
| ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} | |
| ENABLE_MINIFY: 'true' | |
| USE_PROD_CONFIG: 'true' | |
| IS_NIGHTLY: ${{ case(github.ref == 'refs/heads/main', 'true', 'false') }} | |
| run: | | |
| pnpm install --frozen-lockfile | |
| # Desktop-specific release artifact with desktop distribution flags. | |
| DISTRIBUTION=desktop pnpm build | |
| pnpm zipdist ./dist ./dist-desktop.zip | |
| # Default release artifact for core/PyPI. | |
| pnpm build | |
| pnpm zipdist | |
| - name: Upload dist artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: dist-files | |
| path: | | |
| dist/ | |
| dist.zip | |
| dist-desktop.zip | |
| draft_release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download dist artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: dist-files | |
| - name: Create release | |
| id: create_release | |
| uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0 | |
| with: | |
| # GITHUB_TOKEN is refused on core/* lines — 403 "Resource not | |
| # accessible by integration" with contents: write granted. | |
| token: ${{ secrets.PR_GH_TOKEN }} | |
| files: | | |
| dist.zip | |
| dist-desktop.zip | |
| tag_name: v${{ needs.build.outputs.version }} | |
| target_commitish: ${{ github.event.pull_request.base.ref }} | |
| make_latest: >- | |
| ${{ github.event.pull_request.base.ref == 'main' && | |
| needs.build.outputs.is_prerelease == 'false' }} | |
| draft: ${{ needs.build.outputs.is_prerelease == 'true' }} | |
| prerelease: >- | |
| ${{ needs.build.outputs.is_prerelease == 'true' }} | |
| generate_release_notes: true | |
| publish_types: | |
| needs: build | |
| uses: ./.github/workflows/release-npm-types.yaml | |
| with: | |
| version: ${{ needs.build.outputs.version }} | |
| ref: ${{ github.event.pull_request.merge_commit_sha }} | |
| secrets: inherit | |
| comment_release_summary: | |
| name: Comment Release Summary | |
| needs: | |
| - draft_release | |
| - publish_types | |
| if: success() | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout merge commit | |
| uses: actions/checkout@v7 | |
| with: | |
| ref: ${{ github.event.pull_request.merge_commit_sha }} | |
| fetch-depth: 2 | |
| - name: Post release summary comment | |
| uses: ./.github/actions/comment-release-links | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| version_file: package.json |