Skip to content

CI: Upload release artifacts from release-please - #23

Open
Kyo-s-s wants to merge 1 commit into
mainfrom
release-please-upload
Open

Kyo-s-s wants to merge 1 commit into
mainfrom
release-please-upload

Conversation

@Kyo-s-s

@Kyo-s-s Kyo-s-s commented Mar 11, 2026

Copy link
Copy Markdown
Owner

Release-please が release を作成したときだけビルドして、zip をそのリリースに添付します。

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the GitHub Actions release pipeline so the extension is built only when release-please actually creates a GitHub Release, and then uploads the packaged zip as a release asset.

Changes:

  • Expose release-please outputs (release_created, tag_name) and conditionally run downstream jobs only when a release is created.
  • Add a reusable workflow (build-extension.yml) that builds/packages the extension and uploads a zip artifact with a versioned name.
  • Refactor the existing build workflow to call the reusable build workflow and remove the old “on release published” upload path.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/release-please.yml Adds conditional build + gh release upload to attach artifacts only when a release is created.
.github/workflows/build-extension.yml Introduces a reusable build workflow producing a named zip artifact.
.github/workflows/build-artifact.yml Refactors to reuse build-extension.yml and removes the legacy release-published upload job.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +27 to +38
build:
needs: release-please
if: needs.release-please.outputs.release_created == 'true'
uses: ./.github/workflows/build-extension.yml

upload-release:
needs: [release-please, build]
if: needs.release-please.outputs.release_created == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
steps:

Copilot AI Mar 11, 2026

Copy link

Choose a reason for hiding this comment

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

The reusable build job will inherit the workflow-level permissions (contents: write, pull-requests: write), which is broader than needed for a checkout/build/package. Consider setting job-level permissions (e.g., contents: read) for build and scoping write permissions only to the jobs that actually need them (release-please, upload-release) to follow least-privilege.

Copilot uses AI. Check for mistakes.

- name: Upload release asset
run: |
gh release upload "${{ needs.release-please.outputs.tag_name }}" "dist/${{ needs.build.outputs.zip_name }}"

Copilot AI Mar 11, 2026

Copy link

Choose a reason for hiding this comment

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

gh release upload will fail if the asset with the same filename already exists on the release (e.g., workflow re-run, or release-please re-creates the release). Consider making the upload idempotent by using the CLI's overwrite option (e.g., --clobber) or by deleting/replacing the existing asset before uploading, similar to how overwrite_files: true is used elsewhere.

Suggested change
gh release upload "${{ needs.release-please.outputs.tag_name }}" "dist/${{ needs.build.outputs.zip_name }}"
gh release upload --clobber "${{ needs.release-please.outputs.tag_name }}" "dist/${{ needs.build.outputs.zip_name }}"

Copilot uses AI. Check for mistakes.
@Kyo-s-s

Kyo-s-s commented Mar 11, 2026

Copy link
Copy Markdown
Owner Author

なんか動かなさそうなよくわからん差分だな...

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