selinger / katahex

Other
5 stars 0 forks source link

Publish pre-built windows binaries using GitHub actions #1

Closed eilvelia closed 7 months ago

eilvelia commented 7 months ago

This workflow is activated by pushing a tag (for example, git tag prebuilt-2024-04-17 && git push --tags) or by triggering it manually (in the github web interface, or by running gh workflow run release.yml using gh). It currently creates a draft release, so it must be manually accepted (by editing it) on the releases page to be visible to others.

The included binaries are for windows only, built for opencl and eigen.

Example release

selinger commented 7 months ago

Does the workflow run server side? I don't have any Windows computer to build executables on.

eilvelia commented 7 months ago

Yes, yes. You just need to push a tag and it runs on GitHub servers.

eilvelia commented 7 months ago

I see that you pushed a tag but nothing happened. Could it be because the commit was merged too recently and github didn't register the workflow yet? You can try to trigger the workflow manually at https://github.com/selinger/katahex/actions/workflows/release.yml

selinger commented 7 months ago

I also noticed that nothing happened. I now manually triggered the workflow as you suggested. Something is "in progress".

eilvelia commented 7 months ago

Unfortunately there's another issue, the workflow failed to create a release because of insufficient permissions (it worked on my fork though). Perhaps this depends on the "Workflow permissions" default value in https://github.com/selinger/katahex/settings/actions (the first one, "Read and write permissions", is more permissive).

In any case, if that is already set to "Read and write", it can be fixed by modifying the release.yml file again:

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 343ebbdc..0e68af6f 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -9,6 +9,8 @@ jobs:
   build-windows-x64:
     name: Build / Windows x86-64
     runs-on: windows-latest
+    permissions:
+      contents: write
     steps:
       - uses: actions/checkout@v4
       - name: vcpkg cache
selinger commented 7 months ago

Updated permissions and trying again.

selinger commented 7 months ago

Seems to have worked.

eilvelia commented 7 months ago

The workflow finished successfully, you only need to make the release public at https://github.com/selinger/katahex/releases/tag/untagged-84f4a60db352a70718dc by clicking the edit button and publishing it, possibly also specifying the prebuilt-2024-04-17 tag in case the tag is not set (if needed, the workflow can be changed to make the release public (non-draft) right away if triggered by a tag, I'm not sure about manual trigger though).

eilvelia commented 7 months ago

Yes, great :)