chore(release): update release workflow to create draft releases

- Changed the workflow to create draft releases instead of published ones.
- Added a new job to publish the draft release after successful builds, enhancing the release process.
- Updated relevant steps to reflect the new draft status for releases.
This commit is contained in:
Steven Enamakel
2026-03-30 15:35:34 -07:00
parent d9cc41be05
commit 9261561f25
+22 -2
View File
@@ -165,7 +165,7 @@ jobs:
release_id: ${{ steps.create.outputs.release_id }}
upload_url: ${{ steps.create.outputs.upload_url }}
steps:
- name: Create published release with generated notes
- name: Create draft release with generated notes
id: create
uses: actions/github-script@v7
with:
@@ -192,7 +192,7 @@ jobs:
tag_name: tag,
target_commitish: target,
name: `OpenHuman v${version}`,
draft: false,
draft: true,
prerelease: false,
generate_release_notes: true,
});
@@ -528,6 +528,26 @@ jobs:
path: |
${{ steps.cli-paths.outputs.cli_path }}
publish-release:
name: Publish draft release
runs-on: ubuntu-latest
environment: Production
needs: [create-release, build-artifacts]
if: needs.build-artifacts.result == 'success'
steps:
- name: Publish release
uses: actions/github-script@v7
with:
script: |
const releaseId = Number('${{ needs.create-release.outputs.release_id }}');
await github.rest.repos.updateRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: releaseId,
draft: false,
});
core.info(`Published release ${releaseId}`);
cleanup-failed-release:
name: Remove release and tag if build failed
runs-on: ubuntu-latest