min icon indicating copy to clipboard operation
min copied to clipboard

enable Github Actions build with os matrix

Open alswl opened this issue 9 months ago • 6 comments

This issue enables GitHub Actions to build with an OS matrix and automatically generate a release draft. Upon completion of the pipeline, a release will be drafted automatically.

The workflow operates similarly to this example. The release is similarly to this.

alswl avatar Apr 27 '24 16:04 alswl

Thanks! I think the matrix changes look good.

I'm a little bit skeptical about importing a third-party action that has permissions to directly upload releases. Is there a way to scope GITHUB_TOKEN so that it can only publish draft releases? If not, I'd probably prefer to keep uploading the artifacts manually.

PalmerAL avatar Apr 27 '24 19:04 PalmerAL

Hi @PalmerAL ,

For a better understanding of GITHUB_TOKEN and its permissions in GitHub Actions, you can refer to the official documentation. It outlines how the token is used and what permissions it has by default.

The grant feature seems to be tailored for workflows, allowing you to manually adjust the permissions for specific pipelines as detailed here.

Additionally, svenstaro/upload-release-action is a popular action that operates at the repository level only. Given this scope limitation, using the token with this action should be secure.

alswl avatar Apr 28 '24 00:04 alswl

@PalmerAL ping.

alswl avatar May 06 '24 08:05 alswl

@PalmerAL Is this pull request applicable to this project. If it is feasible, I will resolve the conflict, otherwise I will close it.

alswl avatar May 30 '24 00:05 alswl

Sorry, I forgot about this. I don't think github_token supports a fine-grained enough scope to limit to only draft releases (assuming this is still true: https://stackoverflow.com/questions/67389957/what-permissions-does-github-token-require-for-releases-from-a-github-action). So I don't want to move forward with that part.

The reorganization of the action seems good, so up to you if you want to go forward with that.

PalmerAL avatar Jul 10 '24 04:07 PalmerAL

@PalmerAL OK, I removed the drafting release action. Please review my pull-request again.

alswl avatar Jul 10 '24 13:07 alswl

Thanks!

PalmerAL avatar Jul 17 '24 02:07 PalmerAL