-
-
Notifications
You must be signed in to change notification settings - Fork 972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add: [Actions] release workflow for both releases and nightlies #8371
Conversation
I'll look at |
628a813
to
e126cd9
Compare
My particular answers for To Consider:
|
I'll cover the macOS ARM builds and Universal builds, but will likely wait for this PR to be merged first. |
Attaching binaries to GitHub for releases is probably useful as there will be people that look for them on the GitHub Release tab first. I don't think having nightlies here as well makes sense, will just clutter the list way too much. |
I tempt to agree with you. And yes, I meant for releases only :D Oops .. should have been more clear :P For nightlies it is not even possible. Look at me, scoping the PR :D W00p! |
fc8b750
to
7bafbb6
Compare
Unsure if |
7bafbb6
to
fee7948
Compare
Fixed |
7169bfe
to
a7977fd
Compare
a7977fd
to
b0879c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More questions than problems
workflow_dispatch: | ||
inputs: | ||
ref: | ||
description: 'Ref to build (for Pull Requests, use refs/pull/NNN/head)' | ||
required: true | ||
repository_dispatch: | ||
# client_payload should be the same as the inputs for workflow_dispatch. | ||
types: | ||
- Build* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite understand what these are for, can you explain?
Relatedly, why are the nightlies not triggered with a cron, e.g. https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#onschedule ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like I don't know about schedule
.. pfft :P See OpenTTD/workflows#10 :)
workflow_dispatch
means we have a new button in the GitHub interface that allows us to make a binary release of anything, anytime. This makes rebuilding easier, but also building PRs possible.
repository_dispatch
is similar, but for automated triggers. A while ago we decided to move all those workflows into https://github.com/OpenTTD/workflows . This has mostly to do with forks. If you fork this repo, these days by default schedules are disabled; but this was not always the case. Additionally, if you enable it once for what-ever reason, it remains on for 90 days. So that is pretty noisy. So we decided to move all the schedule stuff to https://github.com/OpenTTD/workflows, as it is very unlikely anyone would fork that.
Additionally, the schedule code is not straightforward. It does not support timezones, but also it cannot check if there was anything new. That complexity is now all in OpenTTD/workflows#10, as it really has nothing to do with OpenTTD.
In https://github.com/OpenTTD/workflows you will find more lovely glue-code we use for our infra :) It also triggers eints commits, publishes the docs, rebuilds the website, etc :)
- name: Checkout (Release) | ||
if: github.event_name == 'release' | ||
uses: actions/checkout@v2 | ||
with: | ||
# We generate a changelog; for this we need the full git log. | ||
fetch-depth: 0 | ||
|
||
- name: Checkout (Manual) | ||
if: github.event_name == 'workflow_dispatch' | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.inputs.ref }} | ||
# We generate a changelog; for this we need the full git log. | ||
fetch-depth: 0 | ||
|
||
- name: Checkout (Trigger) | ||
if: github.event_name == 'repository_dispatch' | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.client_payload.ref }} | ||
# We generate a changelog; for this we need the full git log. | ||
fetch-depth: 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to set a 'ref' variable to use rather than duplicating this 3 times?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, kind of. But it would require a bash
rule with the if
logic in there to deduce which ref to use. The downside of that is, it is really easy to fuck that up. This now is trivially correct, and is why I prefer it. It does require a step extra .. but as you can see in a step later where we figure out the branch-name .. that code is not pretty, and really easy to mess up :) (which I also did, as it turns out :P)
So if you don't mind, I prefer this way. If you do mind, I can rewrite it .. but no guarantees :D
(I hope GitHub comes with some updates soon that I can also remove the other bash blob, and integrate it into these blobs .. but the actions/checkout
needs some changes for that :D).
Co-authored-by: Owen Rudge <owen@owenrudge.net>
This in preparation for other architectures, like arm64.
This has several ways of being triggered: - When creating a new release via the GitHub interface. Fully automated that will produce new binaries, upload them, and it will even update the website to tell about the new version. - When triggered in an automated way from OpenTTD/workflows to start a nightly. - Manually via the Release workflow, which accepts branches, Pull Requests and tags to build. Rerunning a job is safe and should be without issues. Everything retriggers and updates what-ever might have been broken. In fact, except for dates, it should produce identical results. Co-authored-by: Charles Pigott <charlespigott@googlemail.com>
Azure Pipelines has build our releases for two years now, but we are finally switching to GitHub Actions. This to bring the full workflow to a single place, making it easier for people to see what is going on and how to influence the process.
b0879c7
to
324c01e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About time we had working nightlies again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok for me too.
Fixes #8330
Fixes #8309
Depends on OpenTTD/workflows#10
A nightly run looks something like this:
https://github.com/TrueBrain/OpenTTD/actions/runs/420435699
A release run something like this:
https://github.com/TrueBrain/OpenTTD/actions/runs/420414947
(I tagged a fictional version in my own fork; you can ignore that completely)
Targets currently not included
Choices made
.deb
builds are only made for releases, not for nightlies.