New scripts and features that together enable quick release of a new Potku version on GitHub. From running bump_version.py on a terminal to having a new release on GitHub takes somewhere between 5 to 10 minutes depending on whether C apps need to be recompiled or not.
bump_version.py
A Python script that can be run on a terminal to bump Potku's version. Requires Git and GitHub CLI to be installed and configured. Basically creates a branch for a version bump and creates a pull request for said branch.
external_file_manager.py and external_manifest.txt
external_manifest.txt acts as a list of external files that the external_file_manager.py script uses to manage the files and is the only thing committed to the repository in terms of external data. The text file contains their relative paths to Potku's root, the files' SHA256 hashes, date of said hash and a file ID portion of the link to Drop Box. The script has various simple commands to edit the manifest file. Only manual element in this is that if a link of a file changes or a new file is added, the new links must be edited in manually. These should change rarely, so this shouldn't be an issue.
JYU_Potku_Devs@gmail.com and associated Drop Box account
A new Gmail account for Potku dev's and an associated Drop Box account. Drop Box is used as cloud storage for Potku's external data files as it provides direct permanent links to files. The credentials to these accounts will be stored in Potku's Teams server.
.yml files
version_bump.yml handles the process of automatically merging version bump pull requests and tagging the new version on GitHub. Checks that the pull request creator has write permissions and that only version.txt changed with valid content. Runs the other .yml scripts as subscripts.
compile_c_apps.yml handles the compilation of the C binaries for each OS. The script runs only if no previous artifacts exist or if the contents of ./external have changed since the previous tag.
package_potku.yml handles the packaging of Potku into standalone binaries for each OS. This script also uses the new addidition of external_file_manger.py together with external_manifest.txt to handle the download of external data files and Awk.exe for Windows.
version.txt
Text file that contains the version number and date of said version. File must be in Potku's root. Version number is matched with a regex both in the bump_version.py script upon input and in the version_bump.yml file.
Changes
A new dev directory has been added to Potku's root. This directory now contains all developer-used scripts that don't have to be in Potku's root.
All the moved scripts and README instructions have been changed accordingly to work with the new locations.
Potku's UI now uses the version.txt file to dynamically show the version number and date in the software. Fallback default values are set in case version.txt is missing or something is wrong with it.
About window's URL list is updated to include an URL for this repository.
.external/share/masses.dat and .external/share/stoppings.txt are deleted from the repository and moved into Drop Box for external_file_manager.py to handle.
Finishing touches required in repository settings
The pull request can be accepted even before this, but there are some settings that need to be enabled for the automatic version bumping and packaging to finally work.
Settings -> Actions -> Actions permissions: Allow all actions and reusable workflows
Settings -> Actions -> Workflow permissions: Read and write permissions
Settings -> Actions -> Workflow permissions: Allow GitHub Actions to create and approve pull requests
Finally I recommend squash merging this PR as there are a lot of commits that were made in the process of writing and testing these scripts, but which don't in the grand scheme of things contain any useful information individually.
Additions
New scripts and features that together enable quick release of a new Potku version on GitHub. From running bump_version.py on a terminal to having a new release on GitHub takes somewhere between 5 to 10 minutes depending on whether C apps need to be recompiled or not.
bump_version.py
A Python script that can be run on a terminal to bump Potku's version. Requires Git and GitHub CLI to be installed and configured. Basically creates a branch for a version bump and creates a pull request for said branch.
external_file_manager.py and external_manifest.txt
external_manifest.txt
acts as a list of external files that theexternal_file_manager.py
script uses to manage the files and is the only thing committed to the repository in terms of external data. The text file contains their relative paths to Potku's root, the files' SHA256 hashes, date of said hash and a file ID portion of the link to Drop Box. The script has various simple commands to edit the manifest file. Only manual element in this is that if a link of a file changes or a new file is added, the new links must be edited in manually. These should change rarely, so this shouldn't be an issue.JYU_Potku_Devs@gmail.com and associated Drop Box account
A new Gmail account for Potku dev's and an associated Drop Box account. Drop Box is used as cloud storage for Potku's external data files as it provides direct permanent links to files. The credentials to these accounts will be stored in Potku's Teams server.
.yml files
./external
have changed since the previous tag.version.txt
Text file that contains the version number and date of said version. File must be in Potku's root. Version number is matched with a regex both in the bump_version.py script upon input and in the version_bump.yml file.
Changes
dev
directory has been added to Potku's root. This directory now contains all developer-used scripts that don't have to be in Potku's root..external/share/masses.dat
and.external/share/stoppings.txt
are deleted from the repository and moved into Drop Box forexternal_file_manager.py
to handle.Finishing touches required in repository settings
The pull request can be accepted even before this, but there are some settings that need to be enabled for the automatic version bumping and packaging to finally work.
Finally I recommend squash merging this PR as there are a lot of commits that were made in the process of writing and testing these scripts, but which don't in the grand scheme of things contain any useful information individually.