Starting GitHub actions where needed
Tags: actionshackathon21, opensource, devops, github
Published: 2021-12-08 22:14:07

[Instructions]: # (To submit to the GitHub Actions x DEV Hackathon 2021, please fill out all sections.)

### My Workflow

#### How I chose this repository

I searched for open source projects that would be interesting, and I came across a project in its early development stages (6 months since its first commit). It caught my attention because it provides support for developing text-based interfaces using C++ 20 and at the time its building actions could be improved.

{% github https://github.com/gdt050579/AppCUI %}

#### [AppCUI](https://github.com/gdt050579/AppCUI) 

AppCUI is a cross-platform text-based user interface. It offers support for building complex interfaces using basic bulding blocks, such as Window, Button, Label, etc.

You can find more [here](https://github.com/gdt050579/AppCUI#readme). The [license](https://github.com/gdt050579/AppCUI/blob/main/LICENSE) is permissive.

### DIY Deployments

The first action I integrated into the repository was [CodeQL analysis](https://github.com/gdt050579/AppCUI/blob/main/.github/workflows/codeql-analysis.yml).

Since the project doesn't have a release method right now, I decided to propose a solution for automatically uploading the binaries when the build is done when a tag is submitted having a specific format v`MajorVers`.`MinorVers`.`PatchVersion`.

This is only the stepping stone because the real automated workflow would now require (in my opinion) any interaction from the user, and it would automatically increase the version number.

When there are found merges to the release branch → it triggers an PatchVersion increment and could also increase the MinorVersion depending on the number of commits and on the complexity. MajorVersion will only be increased manually because it will mean a huge change in the codebase has been made.

### Release action

Those release actions are present on [my fork](https://github.com/rzaharia/AppCUI) of the repo because I didn't want to disturb other contributors until I have something that is well thought, and it's working as expected.

The [release action](https://github.com/rzaharia/AppCUI/blob/main/.github/workflows/deploy_release.yml), at the moment, consists of three steps:
* pushing the tag with a specific format v`MajorVers`.`MinorVers`.`PatchVersion` that triggers the release action
* building the project for each platform using cmake (Windows, Linux and Mac) and uploading the binaries using the action [upload-artifact@v2](https://github.com/actions/upload-artifact)
* getting version name from the tag
* downloading the artifacts (using the download-artifact@v2 action) and creating the release packages for users to be able to simply download the required binary. For example, the `AppCUI_linux_release.zip` contains an include folder where the headers are present, and the framework is built both statically and dynamically. 

Results can be seen [here](https://github.com/rzaharia/AppCUI/releases).

### Future development

I will extend the release workflow to support automatically increasing the version of the build when new code is merged into the release branch. 

In conclusion, this was a wonderful experience and could learn a lot. I will continue to develop and adjust the workflow when I discover new and better methods.