Skip to content

Consolidate release artifacts, simplify release_tag usage, fix release creation order, and modernize with JavaScript#10490

Merged
pelikhan merged 9 commits into
mainfrom
copilot/merge-docker-image-steps
Jan 17, 2026
Merged

Consolidate release artifacts, simplify release_tag usage, fix release creation order, and modernize with JavaScript#10490
pelikhan merged 9 commits into
mainfrom
copilot/merge-docker-image-steps

Conversation

Copilot AI commented Jan 17, 2026

Copy link
Copy Markdown
Contributor

Plan: Consolidate release artifacts and fix release creation order

  • Understand the current release workflow structure
  • Merge docker-image job steps into the release job
  • Merge generate-sbom job steps into the release job
  • Simplify release_tag usage
  • Fix release creation order
  • Rewrite compute release configuration step in JavaScript
  • Use release ID to fetch release data (draft mode compatibility)
  • Revert action version downgrade
  • Validate the workflow compiles without errors

Summary

Successfully consolidated release artifacts into a single job, simplified release_tag usage, fixed the release creation order, rewrote configuration logic in JavaScript, and ensured draft release compatibility.

Workflow Consolidation:

  • Removed docker-image job (122 lines)
  • Removed generate-sbom job (52 lines)
  • Added all build steps to release job
  • Net reduction: ~174 lines of code

Release Tag Simplification:

  • Removed redundant release_tag output from release job
  • All jobs now directly reference needs.config.outputs.release_tag
  • Single source of truth for release configuration

Release Creation Order Fix:

  • Before: gh-extension-precompile created release immediately, then artifacts added later
  • After: All artifacts built first, then release created atomically with everything attached
  • Removed intermediate upload steps (checksums, SBOM attachments)
  • Draft mode handled correctly at release creation time

JavaScript Refactoring:

  • Before: 49-line bash script with gh CLI calls
  • After: Concise JavaScript using GitHub REST API via actions/github-script
  • More readable with modern syntax (arrow functions, destructuring, template literals)
  • Automatic authentication (no GH_TOKEN env var needed)

Draft Release Compatibility:

  • Agent job now uses gh api with release ID to fetch release data
  • Works correctly for draft releases (gh release view may fail for drafts)
  • Ensures reliable release data retrieval regardless of draft status

Version Management:

  • Restored actions/github-script@v7.1.0 (was incorrectly downgraded to v7.0.1)
  • Maintains latest compatible versions for all actions

Benefits:

  • Faster workflow: All build steps run in one job
  • Simpler: Fewer jobs, clearer data flow, more maintainable code
  • Atomic releases: All artifacts attached at once, no partial releases
  • Draft-compatible: Works correctly with draft releases
  • Modern tooling: JavaScript for configuration logic
Original prompt

Merge the docker-image steps into the release job in release.md

Build the docker image before creating the release using the locally built binaries.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 17, 2026 20:38
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Moved Docker Buildx setup, login, metadata extraction, build/push, SBOM generation, and attestation steps into the release job
- Removed the separate docker-image job that was downloading binaries from the release
- Docker image now built using locally built binaries from dist/ directory
- Updated release job permissions already include packages: write for Docker push

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Merge docker-image steps into release job in release.md Build Docker image from local binaries in release job Jan 17, 2026
Copilot AI requested a review from pelikhan January 17, 2026 20:50

@pelikhan pelikhan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot merge generate so mom steps as well

@pelikhan pelikhan marked this pull request as ready for review January 17, 2026 20:53
- Added Go setup and module download steps
- Added SBOM generation (SPDX and CycloneDX formats)
- Added SBOM secrets audit step
- Added SBOM artifact upload and release attachment
- Removed separate generate-sbom job
- SBOM generation now happens immediately after binary build in same job

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jan 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge generate so mom steps as well

Done! Merged the generate-sbom steps into the release job as well (commit 02745e3).

The workflow now has all build steps consolidated:

  • Binary compilation
  • SBOM generation (SPDX + CycloneDX formats)
  • Docker image build and push
  • All in the same release job

Removed both the docker-image and generate-sbom jobs, reducing the workflow by ~174 lines total.

Copilot AI changed the title Build Docker image from local binaries in release job Consolidate release artifacts into single job Jan 17, 2026
Copilot AI requested a review from pelikhan January 17, 2026 21:02

@pelikhan pelikhan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot review workflow and usage of release_tag

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot step to publish release should happen after all binaries, sbom, docker image are built .

- Removed release_tag output from release job (line 119)
- Removed release_tag assignment in get_release step (line 179)
- Updated agent job to use needs.config.outputs.release_tag directly (line 288)
- Eliminates unnecessary pass-through of release_tag value from config to release to agent
- All jobs now consistently reference needs.config.outputs.release_tag

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jan 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot review workflow and usage of release_tag

Reviewed and simplified release_tag usage (commit ac9d41b).

Found issue: The release job was outputting release_tag but just passing through the value from the config job without modification. This created unnecessary indirection.

Fixed by:

  • Removed release_tag output from release job
  • Updated agent job to use needs.config.outputs.release_tag directly (instead of needs.release.outputs.release_tag)
  • All jobs now consistently reference the single source: needs.config.outputs.release_tag

Flow: config job (computes) → release job + agent job (both read directly from config)

No behavioral change, just cleaner architecture with single source of truth.

Copilot AI changed the title Consolidate release artifacts into single job Consolidate release artifacts and simplify release_tag usage Jan 17, 2026
Copilot AI requested a review from pelikhan January 17, 2026 21:15
Comment thread .github/workflows/release.md
- Removed gh-extension-precompile action (was creating release too early)
- Added direct binary build step using scripts/build-release.sh
- Removed intermediate "Set draft mode", "Upload checksums", "Attach SBOM" steps
- Added final "Create GitHub release" step that creates release with all artifacts
- Release now created AFTER binaries, SBOMs, and Docker image are all built
- All artifacts attached atomically: dist/*, sbom.spdx.json, sbom.cdx.json
- Draft mode handled correctly with --draft flag at creation time

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jan 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot step to publish release should happen after all binaries, sbom, docker image are built .

Fixed! Release is now created AFTER all artifacts are built (commit 6078798).

Changes:

  • Removed gh-extension-precompile action (was creating release immediately)
  • Build binaries directly with scripts/build-release.sh
  • Generate SBOMs
  • Build Docker image
  • Then create GitHub release with all artifacts attached atomically

Order now:

  1. Build binaries → 2. Generate SBOMs → 3. Build Docker image → 4. Create release (with all artifacts)

All files (dist/*, sbom.spdx.json, sbom.cdx.json) attached in single gh release create command. Draft mode handled correctly with --draft flag at creation time.

Copilot AI changed the title Consolidate release artifacts and simplify release_tag usage Consolidate release artifacts, simplify release_tag usage, and fix release creation order Jan 17, 2026
- Replaced bash script with actions/github-script@v7
- Uses GitHub REST API to fetch latest release instead of gh CLI
- More concise and readable with JavaScript syntax
- Eliminated need for GH_TOKEN env var (provided by github-script)
- Same functionality: computes next version for workflow_dispatch or uses tag from push event

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Consolidate release artifacts, simplify release_tag usage, and fix release creation order Consolidate release artifacts, simplify release_tag usage, fix release creation order, and modernize with JavaScript Jan 17, 2026
Comment thread .github/workflows/release.md Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot use release id to retreive release data as it is in draft mode

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit 6ca8dc0.

Changed to use gh api "/repos/${{ github.repository }}/releases/$RELEASE_ID" instead of gh release view "$RELEASE_TAG".

Using the release ID via the API ensures the agent can retrieve release data even when it's in draft mode (gh release view with tag may fail for drafts).

"version": "v7.1.0",
"sha": "f28e40c7f34bde8b3046d885e986cb6290c5673b"
"version": "v7.0.1",
"sha": "60a0d83039c74a4aee543508d2ffcb1c3799cdea"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot revert this change, do not update to lower version

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted in commit 6ca8dc0.

Restored actions/github-script to v7.1.0 (was downgraded to v7.0.1 during previous workflow compilation). The file now maintains the correct version.

- Changed agent setup to use gh api with release ID instead of gh release view with tag
- Using release ID works correctly for draft releases (gh release view may fail)
- Reverted action_pins.json to restore actions/github-script@v7.1.0 (was incorrectly downgraded to v7.0.1)
- Maintains compatibility with draft release workflow

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan January 17, 2026 21:39
@pelikhan pelikhan merged commit b5cf079 into main Jan 17, 2026
47 checks passed
@pelikhan pelikhan deleted the copilot/merge-docker-image-steps branch January 17, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants