spinkube / spin-plugin-kube

A Spin plugin for interacting with Kubernetes.
Other
32 stars 7 forks source link

Upload Plugin Manifest with Releases #91

Closed kate-goldenring closed 2 weeks ago

kate-goldenring commented 1 month ago

To ease installation, the plugin manifest (spin-kube.json) should be uploaded with releases. For example, the MQTT trigger does this in their actions: https://github.com/spinkube/spin-trigger-mqtt/blob/main/.github/workflows/build.yaml

bacongobbler commented 4 weeks ago

For context, we're currently using rajatjindal/spin-plugin-releaser@v1 with this plugin which contains the field template_file. I assume that is how the plugin manifest is uploaded with the release.

https://github.com/spinkube/spin-plugin-kube/blob/6f4c9c63ec3210680284c717a69906554912bcbe/.github/workflows/release.yml#L36-L40

I can confirm that the v0.2.0 release did not contain a plugin manifest, so there might be a bug with this github action preventing the json manifest from being uploaded.

Here is the logs from that run: https://github.com/spinkube/spin-plugin-kube/actions/runs/11463602215/job/31897836255

bacongobbler commented 4 weeks ago

If we want to replace the existing github workflow used in this repo with the one used by spin-trigger-mqtt, that would be a fine solution. I hope we can get to a point where all of our plugins are sharing the same CI workflow.

rajatjindal commented 4 weeks ago

If there are no other concerns to continue using the existing workflow, i can take a look as to why the upload didn't work with the current one.

rajatjindal commented 4 weeks ago

I looked into this and there seems to be two problems here:

  1. We do not upload the json file to release assets for tagged releases - that is my design but we can change that easily if so desired.
  2. The PR to the plugins repo is not opened for tagged releases - It seems to be happening due to an issue with Spin. I've reported it here
rajatjindal commented 4 weeks ago

Hi @bacongobbler ,

Apologies for the noise (this issue and the PR's on the plugin repo)

I've made the alternate deployment of the bot using the proposed fix and tested it (sample pr) using curl.

To enable it on the GitHub action, we need to merge the PR and retag: https://github.com/rajatjindal/spin-plugin-releaser/pull/23

thanks

rajatjindal commented 3 weeks ago

Hi @kate-goldenring

This seems to be working now:

PR opened automatically: https://github.com/fermyon/spin-plugins/pull/85

and kube.json added to release: https://github.com/spinkube/spin-plugin-kube/releases/tag/v0.3.1

kate-goldenring commented 2 weeks ago

@rajatjindal thank you! We can close this as resolved 🎉