msys2 / msys2-autobuild

🏭🏭🏭🏭🏭🏭🏭🏭
https://packages.msys2.org/queue
MIT License
35 stars 25 forks source link

how to run msys2-autobuild in a fork? #32

Closed jeremyd2019 closed 3 years ago

jeremyd2019 commented 3 years ago

I am thinking about playing with the self-hosted ARM64 Windows runner, and also it would be cool to use a version of autobuild for i686 msys2 packages instead of my current manually-invoked process.

From what I could tell, this project seems fairly tightly coupled to msys2-web for its data on what to process, so it doesn't seem as simple as just making a fork and starting it running. Could you provide some notes on what would be required to make an autobuild fork run?

lazka commented 3 years ago

Let me clean up the code a bit

jeremyd2019 commented 3 years ago

no rush, just some curiosity to play with.

lazka commented 3 years ago

A bit better now: https://github.com/msys2/msys2-autobuild/blob/master/autobuild.py#L37

There is the assumption though that it handles msys packages, because mingw ones can depend on that. But in theory if you change MINGW_ARCH_LIST, MINGW_SRC_ARCH and REPO it should maybe work.

Re the msys build requirement, I have a refactoring planned that should make that easier, in case that is a show stopper.

jeremyd2019 commented 3 years ago

Had to create a PAT (not sure what rights to give it, just gave it public repos, might not even have needed that) and put in repo secrets GITHUBTOKENREADONLY. Then I had to create releases staging-{mingw,msys,failed} and status. Then it seemed able to run 'schedule'

Update: seems PAT with no rights works just fine

lazka commented 3 years ago

In theory it should fall back to GITHUB_TOKEN: https://github.com/msys2/msys2-autobuild/blob/78b3da87270a689f9d07979491c55e3eb151b4f8/autobuild.py#L1239

Only downside being that you are limited to 1000 requests/h, but that should be enough for one build type.

jeremyd2019 commented 3 years ago

In theory, but in practice it failed for me getting the workflow

jeremyd2019 commented 3 years ago

In theory, but in practice it failed for me getting the workflow

I think if the secret is not set ,the workflow will set the GITHUB_TOKEN_READONLY var in the env to an empty string?

lazka commented 3 years ago

ah, true, would ${{ secrets.GITHUBTOKENREADONLY || secrets.GITHUB_TOKEN }} work? or we check of empty strings in the script

jeremyd2019 commented 3 years ago

I think either would work, as long as secrets.GITHUBTOKENREADONLY isn't something stupid like 0 😉

jeremyd2019 commented 2 years ago

I finally got around to nuking the PAT from the secrets of my fork, and this now works falling back to the GITHUB_TOKEN