From fd825d84b6cd021b24c16991655e46a5e2b8b898 Mon Sep 17 00:00:00 2001 From: Shawn Rushefsky Date: Wed, 15 Jan 2025 17:31:28 -0500 Subject: [PATCH] Workflow fixes (#19) * get version correctly * don't create releases for changes in docker dir * multi-line syntax in release creation * allow manually running docker build * permissions for the job * more accurate name --- .github/workflows/build-docker-images.yml | 6 +++++- .github/workflows/create-release.yml | 15 ++++++++++++--- .github/workflows/pr-build.yml | 1 + docker/push-api-images | 4 ++-- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-docker-images.yml b/.github/workflows/build-docker-images.yml index dec5eef..009af06 100644 --- a/.github/workflows/build-docker-images.yml +++ b/.github/workflows/build-docker-images.yml @@ -4,9 +4,13 @@ on: release: types: - published + workflow_dispatch: {} jobs: - build: + build-and-push: + permissions: + contents: read + packages: write runs-on: ubuntu-latest steps: diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index f97f44c..f0650ca 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -13,6 +13,7 @@ on: - "**.yml" - "test/**" - "example-workflows/**" + - "docker/**" workflow_dispatch: {} jobs: @@ -37,14 +38,22 @@ jobs: id: version run: echo "version=$(jq -r .version package.json)" >> "$GITHUB_OUTPUT" - - name: Get the PR that was merged into main + - name: Get the title and body from the last merged PR id: pr-output env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | info=$(gh pr list --state merged --limit 1 --json title,body | jq -r '.[0]') - echo "title=$(echo $info | jq '.title')" >> "$GITHUB_OUTPUT" - echo "body=$(echo $info | jq '.body')" >> "$GITHUB_OUTPUT" + { + echo 'title<> "$GITHUB_OUTPUT" + { + echo 'body<> "$GITHUB_OUTPUT" - name: Create a release uses: actions/create-release@v1 diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index e4f3d28..1d607d3 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -11,6 +11,7 @@ on: - "generate-workflow" - "test/**" - "example-workflows/**" + - "docker/**" jobs: build: diff --git a/docker/push-api-images b/docker/push-api-images index 293f378..b40a26a 100755 --- a/docker/push-api-images +++ b/docker/push-api-images @@ -6,10 +6,10 @@ comfy_version=${1:-0.3.10} torch_version=${2:-2.5.0} cuda_version=${3:-12.1} -current_api_version=$(cat package.json | jq -r '.version') +current_api_version=$(cat ../package.json | jq -r '.version') api_version=${4:-$current_api_version} -bases=("runtime" "devel") +bases=("devel" "runtime") for base in "${bases[@]}"; do docker push ghcr.io/saladtechnologies/comfyui-api:comfy$comfy_version-api$api_version-torch$torch_version-cuda$cuda_version-$base