Skip to content

Conversation

@zephyris
Copy link
Contributor

We'd like to add OpenGFX2 automatic builds and cdn uploads, to make it a mature part of OpenTTD.

This is a (very) draft PR to set up release workflows. It is little more than a copy/paste of the OpenGFX(1) workflows, with a couple of basic modifications. Intended as a start point to discuss how I've got it wrong, and what the next steps would be.

@zephyris zephyris marked this pull request as draft June 19, 2025 19:01
@zephyris
Copy link
Contributor Author

I've done some basic repo digging, and these are the points I've found:

Add workflows to OpenGFX2: Use OpenGFX as a template, copy and update: https://github.com/OpenTTD/OpenGFX/tree/master/.github/workflows
[this is what I've tried to do with this PR]

Update OpenGFX2 build process to match the expectations of baseset release workflows: https://github.com/OpenTTD/actions/blob/main/.github/workflows/rw-entry-release-baseset.yml https://github.com/OpenTTD/actions/blob/main/.github/workflows/rw-baseset-build.yml https://github.com/OpenTTD/actions/blob/main/.github/workflows/rw-baseset-metadata.yml
[This requires a few decisions about exactly what to package in the release bundles - tpresumably just the Classic version? And, whether we want do package the source too.]

Update OpenTTD website, adding OpenGFX2 or changing existing OpenGFX page to point at OpenGFX2: https://github.com/OpenTTD/website/blob/main/_download-meta/opengfx-nightlies.md https://github.com/OpenTTD/website/blob/main/_download-meta/opengfx-releases.md

@TrueBrain
Copy link
Member

FYI: if you use setup-python, you already get a Python problem-matcher installed. So no need to do that yourself. You only need to install ones for custom languages (like nml) :)

@TrueBrain
Copy link
Member

TrueBrain commented Jun 21, 2025

I have been fiddling around with this:
fe5617a

I am running against all kinds of small issues, which suggests to me I am not using the same setup as you are. I would be curious to know:

  • What Python version are you using?
  • What is your output of pip freeze.

As the issues I run up against makes no sense to me :) Either way, if I can't compile it, neither can the CI, so we first have to figure out what I am doing wrong :)

Edit: issue was I was trying Python 3.8. You need 3.12+. Didn't investigate why.

@TrueBrain TrueBrain changed the title Release workflows Codechange: Set up testing/release workflows Jun 21, 2025
@TrueBrain
Copy link
Member

TrueBrain commented Jun 21, 2025

We might want to add some automation to set NAMING_VERSION depending on git-conditions. Just so you can lazy-release via GitHub releases, and not require a commit first (which people will forget :P )

@TrueBrain
Copy link
Member

TrueBrain commented Jun 21, 2025

https://github.com/OpenTTD/OpenGFX2/commits/release-workflows-tb/

I think in theory that that branch should "just work". I currently can't test it as I am blocked by an unreleased nml. So we have to pursue that first :)

It is important to note that every attempt to make this release-flow work costs 8 dollarcent. It isn't a monumental large number, but just something to keep in mind while we are experimenting. And I estimate a release will take ~1 hour. So it will also require some ... "prethinking" :D

But I think I caught all ins/outs. I also changed the NAMING_VERSION above the follow the normal OpenTTD trick, and use git information to create a version.

I also removed the "testing.yml", for two reasons:

  1. I don't see a realistic world where people want to wait 1+ hour for a PR to be approved by the CI.
  2. it is 8 dollarcent per PR run. This can get really expensive really quick. So for now I rather work on the: "I trust you, it should be fine" approach, and assume people tested it locally.

PS: this eventually needs OpenTTD/actions#95 before my branch can be pushed to this PR to merge.
PPS: we need to introduce any workflow first before GitHub allows us to execute a workflow in a branch. So I will make a PR to add something dummy.

@zephyris
Copy link
Contributor Author

zephyris commented Jun 21, 2025

Thank you!

  • I'll update to remove the python problem matcher

  • These are two confirmed working Python environments:

Python 3.10.12
pillow==10.3.0
blend-modes==2.1.0
numpy==1.26.4
scikit-image==0.23.2
tqdm==4.66.2
Python 3.12.3
pillow==10.2.0
blend-modes==2.2.0
numpy==1.26.4
scikit-image==0.25.2
tqdm==4.67.0

Which leaves me confused about the numpy errors you mentioned on Discord. But at least can set some working versions!

  • Seems very reasonable to remove testing!

@TrueBrain TrueBrain force-pushed the release-workflows branch from 61f85b0 to 47b9555 Compare June 21, 2025 19:29
@TrueBrain TrueBrain marked this pull request as ready for review June 21, 2025 19:29
@TrueBrain TrueBrain force-pushed the release-workflows branch 4 times, most recently from 2379dc8 to f1768c8 Compare June 22, 2025 08:30
@TrueBrain
Copy link
Member

TrueBrain commented Jun 22, 2025

This is now all done. A test build has succeeded: https://www.openttd.org/downloads/opengfx2_classic-nightlies/latest

This PR currently depends on #205 . Please review & merge that first.

After that, this can be merged. Creating a "tag" will create a new version. Don't forget to update your changelog first if you do so. Every Monday it will create a nightly. And manually you can trigger a nightly whenever you want.

@TrueBrain TrueBrain force-pushed the release-workflows branch from f1768c8 to b34986d Compare June 22, 2025 12:46
Copy link
Contributor Author

@zephyris zephyris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs/releasing-opengfx2.md Should be updated to add the following:
"Creating a "tag" will create a new version. Don't forget to update your changelog first if you do so."

But, needs wider changes, so can be done in separate PR.

Requires `git lfs` for large file handling. Once `git lfs` is installed then clone using `git` as normal.

Requires a system with `make`, `nmlc`, `git` and `python3` with `PIL`, `blend-modes`, `numpy`, `skimage`, `tqdm`. This has been developed using Windows Subsystem for Linux (WSL) and might have peculiarities (eg. incorrect file permissions) on a real Linux install.
Requires a system with `make`, `nmlc`, `git` and `python3` (3.11+) with `PIL`, `blend-modes`, `numpy`, `scikit-image`, `tqdm`. This has been developed using Windows Subsystem for Linux (WSL) and might have peculiarities (eg. incorrect file permissions) on a real Linux install.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not strictly true, python3 3.10 works, but there is some odd interplay with numpy which makes this good advice.

@TrueBrain TrueBrain merged commit 1220ab9 into main Jun 22, 2025
1 check passed
@TrueBrain TrueBrain deleted the release-workflows branch June 22, 2025 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants