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

Add object creator to releases #68173

Merged

Conversation

snipercup
Copy link
Contributor

@snipercup snipercup commented Sep 17, 2023

Summary

Build "add object creator to releases"

Purpose of change

Allow a greater amount of people to make use of the object creator by simply downloading it and running it in the same folder as cataclysm-tiles

Describe the solution

Add build commands to the release.yml workflow in github actions.

  • Both the Linux and the Windows versions are built using the devcontainer. The devcontainer will be uploaded to the github image repository (only when building the windows version since it only needs to be pushed once) so it can be cached to save build time. The first time it will run for about 3 hours and after that it takes about 40 minutes to compile the object creator.

  • The Linux and Windows versions are configured to be built in parallel to the game builds so if one of them fails, the game will still be built succesfully.

  • Both versions are added to a compressed archive and they are shipped with a copy of the QT license.

  • In order for the devcontainer image to succesfully be pushed to ghcr.io, the organisations workflow permissions need to be set to 'read and write permissions' via GitHub profile icon -> Your organizations -> Settings -> Actions -> General -> Enable Read and write permissions but for the org instead. The repository also needs read and write permissions. As per this issue.

Add a menubar to the object creator:
image

Added the about object creator dialog:
image

Added the about qt dialog
image

Describe alternatives you've considered

  • Cross-compile the object creator without devcontainer like in the code that's commented out here. The problem with this is that it can't find some libraries as shown in this run.

  • Make the linux version of the object creator without the devcontainer. It is possible compile it inside the release.yml directly, but when you try to open the binary after downloading it, you run into a undefined symbol: _ZdlPvm, version QT_5 error. This is possibly related to compiling with a different C++ compiler or github actions using different versions of the QT5 framework

Testing

You can see all of the actions I added in this PR be succesfully performed in this run (with most of the other actions removed from the release.yml workflow)

You can see that the steps I added work in-tandem with the rest of the actions in this run. Because I can't trigger github pages rebuild, they all fail but that has nothing to do with my additions.

You can download a working copy of the object creator from my releases here.

Additional context

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [Markdown] Markdown issues and PRs Code: Tooling Tooling that is not part of the main game but is part of the repo. Code: Build Issues regarding different builds and build environments astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Sep 17, 2023
@andrei8l
Copy link
Contributor

The mingw build is statically linked against Qt5 so we need to provide a copy of its LGPL license.

Also, please add the object creator sources to the astyle check (here).

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Sep 17, 2023
@snipercup
Copy link
Contributor Author

snipercup commented Sep 17, 2023

The mingw build is statically linked against Qt5 so we need to provide a copy of its LGPL license.

Of course! I'm looking for the best way to implement this. Should it just be a text file inside a zip file that contains the license and the object creator? Should I put the license text in the object creator somewhere? Maybe I can put a hyperlink in a help->about menu item. What do you recommend?

I could add https://doc.qt.io/qt-5/lgpl.html to license.txt and add that to a zipfile together with the object creator, but the qt5 license doesn't apply to the base game. What about adding the link to the license in the splash screen with the text 'made with qt, see license here:'

@andrei8l
Copy link
Contributor

AFAICT you need to do both, so:

  1. License file distributed with the binary. This can be in License-Qt5.txt, similar to the LICENSE-OFL-Terminus-Font.txt we ship with the game.
  2. Qt5 mentioned in the program somewhere. QApplication::aboutQt() can probably help.

and also:
3. A link to this repo

Makefile Outdated Show resolved Hide resolved
@snipercup snipercup changed the title Add object creator to releases [WIP] Add object creator to releases Sep 18, 2023
@github-actions github-actions bot added the [C++] Changes (can be) made in C++. Previously named `Code` label Sep 18, 2023
@snipercup snipercup marked this pull request as draft September 19, 2023 17:32
snipercup and others added 3 commits September 21, 2023 09:49
Both the windows and linux versions are now built in the devcontainer. The windows version was already built in the devcontainer. I changed the linux version to be built inside the devcontainer too because an error shows up when opening the binary when it was compiled using github actions directly.
@snipercup snipercup changed the title [WIP] Add object creator to releases Add object creator to releases Sep 21, 2023
@snipercup snipercup marked this pull request as ready for review September 21, 2023 08:20
@snipercup
Copy link
Contributor Author

I added the QT license to the object creator directory since it only applies to the object creator. A copy is shipped with a binary release of the object creator.

I had to build the linux version in the devcontainer as well because it would throw an error when comiled using github actions directly. Now the compilation is completely separate from the game compilation. It might as well run inside a separate job outside the matrix. However, it's still a release so I put it in the release workflow.

My actions are done and I marked this PR ready for review.

@Maleclypse Maleclypse merged commit bfdc824 into CleverRaven:master Sep 21, 2023
@snipercup snipercup deleted the pr-add-object-creator-to-releases branch September 21, 2023 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Code: Build Issues regarding different builds and build environments Code: Tooling Tooling that is not part of the main game but is part of the repo. <Documentation> Design documents, internal info, guides and help. json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants