Skip to content

🚀 Cross-Platform CI/CD Pipeline#27

Open
falconmick wants to merge 2 commits intoTheCod3rYouTube:mainfrom
falconmick:main
Open

🚀 Cross-Platform CI/CD Pipeline#27
falconmick wants to merge 2 commits intoTheCod3rYouTube:mainfrom
falconmick:main

Conversation

@falconmick
Copy link

@falconmick falconmick commented May 12, 2025

tldr: adds automatic release and pre releases, see https://github.com/falconmick/PS5NorModifier/releases/ to see it in action and help me validate the binaries work. Oh and adds macOS support

What's Changed - Automated Releases

Added GitHub Actions for automated builds on Windows, MacOS (ARM64/x64), and Linux

build.yml runs a matrix operation over 3 release targets (currently!) which creates 3 separate sets of artifacts for the platforms. Currently windows outputs a single executable however given that serial cannot be baked into the executable for whatever reason on macOS/linux (I am sure it's a good reason) those to artifacts have a lib and an executable.

Implemented automated releases with versioning (v1.2.x)

Upon main updating a release pipeline (release.yml) will execute that creates a new release automagically without any need to run the gh tooling on your machine. Eventually I plan on hooking this into app delivery integrations like choco for windows, home-brew for macOS and to the distros PM's eventually but for now I just wanted to at a minimum automate the process of creating releases to enable more frequent versions with all the PR's coming in thanks to Louis.

note:
All full releases are created as drafts and will require submitting once created, but if your CURRENT_RELEASE is behind MAJOR_VERSION.MINOR_VERSION it will swap your releases to pre-release and automatically publish them (so we can test them first and them bump CURRENT_RELEASE once main is stable.

What still needs to be done?

The main thing that remains is proper testing. I have a UART to USB, however I don't currently have a ps5 mobo (and my ps5 works, so I don't want to pull it apart and damage it given this would be my first go at UART on a ps5) so I plan on reaching out to some friends in my area (Western Australia) looking for donor boards I could nab up to test the artifact it's generating on each platform for my sanity sake.

MacOS support?

With that said, I did open the macOS version on my laptop and it appears to be working so far (so yay Mac supposed now?) and tomorrow I will give my windows box and subsystem for linux terminal a shoot to double check the cli app at least runs even if I don't have a mobo (yet) to test agains. Would love it if anyone could pop over to my releases to see if it works:
https://github.com/falconmick/PS5NorModifier/releases/tag/v1.3.18

Bugs (that I will fix)

  • when you bump major/minor the git log that generates your release cannot find the last release so it shows every commit ever.. I think this won't be too hard a fix all fixed: https://github.com/falconmick/PS5NorModifier/releases/tag/v1.3.0 and explained: 🚀 Cross-Platform CI/CD Pipeline #27 (comment)
  • WIP: don't know if app release is coming through releases yet, will test soon
  • Nice to have: remove some of the magic strings, don't like that I have to do this: cp "UART-CL-win-x64/UART-CL By TheCod3r/UART-CL By TheCod3r/bin/Release/net6.0/win-x64/publish/UART-CL By TheCod3r.exe" ./
  • Nice to have: CLI/App should be their own matrix, would allow for variable usage + simplification of the large matrix includes
  • release is including folder structure, trying to resolve at the moment might need to make the build phase only publish the publish folder too fix, but this Is a tomorrow fix

Validation that it actually works:

It would be good to validate that the compiled artifacts actually work. There might be some weird edgecase of it not working due to my compiler args so I want to see it up and running on each OS and also validate the serial connection actually works.

I need help here - I currently don't have a PS5 mobo to test this against, I do have a jtag reader so I will try to find a mobo, but anyone who has the ability to help me check off the items in the list would be a saint

  • macOS - cli runs
  • macOs - cli can interface with serial connection to open JTAG and return codes
  • linux - cli runs
  • linux - cli can interface with serial connection to open JTAG and return codes
  • windows cli runs
  • windows cli can interface with serial connection to open JTAG and return codes
  • windows app works

See it in action:

Here's what a PR looks like once we have this added (oh did I mention it runs on PR)
image

This is what a complete build looks like:
image

This is what the releasees look like:
image

I think I have created an image for each part of the PR, feel free to pop into my fork to see the actual actions and releases.

Comment on lines +63 to +68
PREV_TAG=$(git tag -l "v*.*.*" | sort -V | while read tag; do
# Only keep tags that are strictly less than our new version
if [ "$(echo -e "${FULL_VERSION}\n${tag}" | sort -V | head -n1)" = "${tag}" ] && [ "${tag}" != "${FULL_VERSION}" ]; then
echo "$tag"
fi
done | tail -n1 || echo "")
Copy link
Author

Choose a reason for hiding this comment

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

takes all the version tags, sorts it, then filters out those greater than the tag we are pushing to and returns the first result back from that (which will be the previous release). "$(echo -e "${FULL_VERSION}\n${tag}" | sort -V | head -n1)" = "${tag}" specifically places the new version (FULL_VERSION) and then the tag we are testing is not greater than it on a new line, such that we can split it with a pipe, which we then sort, then if the head first line is equal to the tag we must have a tag that was greater thatn FULL_VERSION thus we skip it

@falconmick falconmick marked this pull request as draft May 12, 2025 19:59
@falconmick
Copy link
Author

Converted to draft as 4am isn’t a good time to code and I may have broken releases.

already can see fix is to roll back zip changes and fix actual cause of break which was renaming of build artifices which added the nested folders, will go back to publishing publish folder and it will work

@falconmick
Copy link
Author

Once working will apply squash to clean history

@Bryceshaw06
Copy link

Don't have a PS5 I'm working on currently. However, the MacOS command line from your releases at least boots fine for me
Terminal on 05-12-2025 at 08 10PM@2x

* added CI to CLI tool

* added rid for restore

* added innitial release pipeline

* fixed issue with changelog body

* Refactor changelog generation in release workflow to remove newline formatting

* resolved issue with unescaped characters

* added propper release notes

* updated changelog to demo tag versioing

* fixing issue where artifacts not included in release

* diagnosing missing artifact issue

* testing PR only runs build

* more debugging

* zip up linux/macos and specify artifacts

* undid readme change and bumped minor

* removed debug log

* updated PREV_TAG to look back major and minor

* added support for x64 mac

* added support for windows app

* moved env into job to try to fix matrix

* gave up with fancy solution

* added support for x64 to windows

* updated job names to be usable

* added debug for failing release

* fixes to windows artifacts

* fixed artifacts in release to not have folder maze

* fix to zip command to match specific items

* copy over exe from a find

* junking folders in zip, might need a better solution for win app

* added back removed -i

* zip isnt my friend

* last attempt before re-approaching from build tomorrow

* attempt to fix artifact nesting

* added back in windows exe to release

* swapped macos and linux to tar.gz

* fixed artifact names to add to release

* diagnosing issue

* tar.gz linux/macos to preserve executables

* windows doesnt work well with if statements

* fixed bash specific code

* fixed windows to include them into release as zip and exe

* simplified release.yml

* was creating too many release items

* added missing exe

* added docs on how to open on macos

* updated release to include macos instructional picture

* more release doc updating
@falconmick
Copy link
Author

Squashed commits into single commit

@falconmick falconmick reopened this May 13, 2025
@falconmick falconmick marked this pull request as ready for review May 13, 2025 03:30
@falconmick
Copy link
Author

Don't have a PS5 I'm working on currently. However, the MacOS command line from your releases at least boots fine for me Terminal on 05-12-2025 at 08 10PM@2x

thanks for double checking it... I actually had to fix that after the version you used because TIL that .zip files are a menace for macOS/linux executables... now they are in tar.gz and the world is in peace

see latest release from my work here: https://github.com/falconmick/PS5NorModifier/releases

I now have the cli building for: macOS-x64 macOS-arm64, linux-x64, windows-x64
and I am also building the windows app as a 64 bit app (added support in the csproj)

I think this PR is ready for review now, later tonight if I get time I will start a new PR branch that starts pushing the artifacts out to repositories like choco, homebrew and I'll see if I cannot figure out ubuntu/arch too

I still need to do the following after work:

  • test windows binaries are working
  • things I forgot but I will remember

…elopment of release)

* setup pre-release to avoid spamming

* temp release change

* setup workflow_dispatch
@falconmick
Copy link
Author

added support for merged changes to only release as pre-releases.

Now when we don't want a release we can simply do this:

take:

env:
  MAJOR_VERSION: "1"
  MINOR_VERSION: "3"
  CURRENT_RELEASE: "1.3"

and make it :

env:
  MAJOR_VERSION: "1"
  MINOR_VERSION: "4"
  CURRENT_RELEASE: "1.3"

that will make it that until CURRENT_RELEASE is changed to 1.4 all merges will be pre-release

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.

2 participants