Files

52 lines
1.6 KiB
YAML

name: Publish
on:
push:
branches: [ main ]
tags: [ 'v*.*.*' ] # run on version tags too
workflow_dispatch:
permissions:
contents: write # needed to create/update releases & upload assets
actions: read
id-token: none
jobs:
build-and-publish:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set version (from tag if present)
id: ver
shell: pwsh
run: |
$ref = "${{ github.ref }}"
if ($ref -like "refs/tags/*") {
$v = $ref -replace '^refs/tags/', ''
} else {
$v = (Get-Content -Raw -Path pyproject.toml) -match '(?m)^version\s*=\s*"([^"]+)"' | Out-Null
$v = $Matches[1]
}
"version=$v" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
- name: Create zip
shell: pwsh
run: |
$zip = "ComfyUI-LinkModeToggle-${{ steps.ver.outputs.version }}.zip"
Compress-Archive -Path * -DestinationPath $zip -Force
echo "ZIP=$zip" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ComfyUI-LinkModeToggle-${{ steps.ver.outputs.version }}
path: ComfyUI-LinkModeToggle-${{ steps.ver.outputs.version }}.zip
- name: Create GitHub Release (for tags)
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: ComfyUI-LinkModeToggle-${{ steps.ver.outputs.version }}.zip