git-for-windows / git-for-windows-automation

A few GitHub workflows and support code to help with Git for Windows' day-to-day tasks
10 stars 9 forks source link

Optionally keep self-hosted-runners allocated after creating them #11

Closed dscho closed 1 year ago

dscho commented 1 year ago

For now, we manually spin up the runners. It makes more sense to keep them running so that they can pick up the job immediately instead of deallocating them and then manually restart them.

dscho commented 1 year ago

I tested this in conjunction with https://github.com/git-for-windows/git-for-windows-automation/actions/runs/3825495631/jobs/6508527516 and was surprised that the runner did not come online immediately... turns out that I had forgotten about the post-deploy script! I'm not so much of a PowerShell expert, so I want to use the next deployment of an aarch64 package as an excuse to test this before I mark this PR as ready for review.

dscho commented 1 year ago

In the .yml file, I replaced stopService=$env:DEALLOCATE_IMMEDIATELY with stopService={{ env.DEALLOCATE_IMMEDIATELY }}.

I think there is a $ missing before the {{.

But I have a more fundamental concern with using ${{ env.XYZ }} instead of $env:XYZ: the latter is a lot more robust with respect to spaces, quotes and other special characters in the value of the environment variable. In general, I think we should always use the native environment variable expansion in scripts, i.e. $env:XYZ in PowerShell, $XYZ in Bash.

dscho commented 1 year ago

I'm declaring this ready to be merged, after it successfully created several runners in the attempt to build mingw-w64-clang-aarch64-xpdf-tools 😉

dennisameling commented 1 year ago

Thanks for your work on this!! 🔥