Create Release #2
This file contains 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: Create Release | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- ".github/**" | |
- "**.md" | |
- "**.png" | |
- ".gitignore" | |
- "generate-workflow" | |
- "**.yml" | |
- "test/**" | |
- "example-workflows/**" | |
workflow_dispatch: {} | |
jobs: | |
build-and-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- name: Install dependencies | |
run: npm install | |
- name: Build | |
run: npm run build-binary | |
- name: Get version from package.json | |
id: version | |
run: echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT | |
- name: Get the PR that was merged into main | |
id: pr-output | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
info=$(gh pr list --state merged --limit 1 --json title --json body) | |
echo "title=$(echo $info | jq -r '.title')" >> $GITHUB_OUTPUT | |
echo "body=$(echo $info | jq -r '.body')" >> $GITHUB_OUTPUT | |
- name: Create a release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.version.outputs.version }} | |
release_name: ${{ steps.pr-output.outputs.title }} | |
body: ${{ steps.pr-output.outputs.body }} | |
draft: true | |
prerelease: false | |
- name: Upload release artifacts | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ steps.version.outputs.version }} ./bin/comfyui-api#Linux_x64 | |