Skip to content

Commit

Permalink
Workflow fixes (#19)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
shawnrushefsky authored Jan 15, 2025
1 parent 3ab5ca0 commit fd825d8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- "**.yml"
- "test/**"
- "example-workflows/**"
- "docker/**"
workflow_dispatch: {}

jobs:
Expand All @@ -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<<EOF'
echo $info | jq -r '.title'
echo EOF
} >> "$GITHUB_OUTPUT"
{
echo 'body<<EOF'
echo $info | jq -r '.body'
echo EOF
} >> "$GITHUB_OUTPUT"
- name: Create a release
uses: actions/create-release@v1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- "generate-workflow"
- "test/**"
- "example-workflows/**"
- "docker/**"

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions docker/push-api-images
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fd825d8

Please sign in to comment.