BusPirate / Bus_Pirate

Community driven firmware and hardware for Bus Pirate version 3 and 4
625 stars 131 forks source link

github action to make releases on git tags #152

Closed gdamjan closed 2 years ago

gdamjan commented 3 years ago

This github action triggers on tags beginning with v (for ex: v1.0), and builds the firmware using the fstlx/xc16 docker image that contains XC16 and MPLAB X.

Then publishes the built .hex files on github releases, under the same tag

https://hub.docker.com/r/fstlx/xc16

gdamjan commented 3 years ago

some test builds here: https://github.com/gdamjan/Bus_Pirate/releases/tag/v.test and the output can be seen here: https://github.com/gdamjan/Bus_Pirate/runs/1157434979?check_suite_focus=true

gdamjan commented 3 years ago

maybe I should also compile the bootloaders too?

USBEprom commented 3 years ago

@gdamjan

Thank you Sir for the excellent idea and the terrific implementation! I think it might be useful to use the same scheme to compile bootloaders as well, thank you Sir.

One thing I wanted to point out is that the ready to use hexadecimal files that kindly you provide are in lowercase format and so they do not work with some Bus Pirate firmware update tools, it is need to convert them to UPPERCASE before thy can be used with that kind of tools. I am aware that the thing is marginal when speaking of skilled users, but since not all Bus Pirate users may be skilled enough, I think it might be useful to introduce a warning, if not to provide the hexadecimals already in uppercase format. What I have written is not meant to be a criticism, but rather a simple suggestion from a neophyte. Thanks!

gdamjan commented 3 years ago

One thing I wanted to point out is that the ready to use hexadecimal files that kindly you provide are in lowercase format and so they do not work with some Bus Pirate firmware update tools, it is need to convert them to UPPERCASE before thy can be used with that kind of tools.

sure thing, I'll take a look. Do you know which tool is used to convert to uppercase format?

I think it might be useful to use the same scheme to compile bootloaders as well

this is technically easy to do. my only concern is about versioning. there are a couple of options:

what do you think?

USBEprom commented 3 years ago

@gdamjan

Thank you Sir.

By using Windows it is possible to convert a text string from lowercase to UPPERCASE and the other way around with a Windows batch file that convert files from lower to upper case (http://dangerousprototypes.com/forum/index.php?topic=6097.msg56817#msg56817):

@echo off setlocal EnableDelayedExpansion for /F "delims=" %%a in (%1) do ( set "line=%%a" for %%b in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do ( set "line=!line:%%b=%%b!" ) echo !line! )

To use it, run the batch file and pipe output to a temp file, for example, to_upper.bat BPvX-firmware.hex > temp.hex

Again with Windows it is possible to use third party programs, for example Notepad++ (https://notepad-plus-plus.org/downloads/) is able to do that.

Instead by using Linux it seems to me that it is possible to convert a text string from lowercase to UPPERCASE and the other way around by using the built-in bash commands 'echo' and 'tr'. Examples

$ echo convert this to uppercase | **tr** [a-z] [A-Z] CONVERT THIS TO UPPERCASE $

$ echo convert this to lowercase | **tr** [A-Z] [a-z] CONVERT THIS TO UPPERCASE $

While in order to convert a complete file from bash it is possible to use '<' redirect:

$ tr [a-z] [A-Z] **<** convert_to_uppercase.txt CONVERT THIS TO UPPERCASE $

$ tr [A-Z] [a-z] **<** convert_to_lowercase.txt CONVERT THIS TO LOWERCASE $

I have no idea how this can be achieved using operating system from Apple, but I guess it should not be much different than with Linux and Windows.

Regarding concern about versioning, please take a look at this:

https://github.com/BusPirate/Bus_Pirate/issues/115

About a possible solution to the above in relation to the proposed options, I am the least suitable person to give an opinion on that, however I believe that

* separate tag namespaces: build firmware on `v*` tags, build bootloaders on `b*` tags

would be the best solution. Thanks.

gdamjan commented 3 years ago

Yes, I can use tr in the action. Let me double check the results.

gdamjan commented 3 years ago

https://github.com/gdamjan/Bus_Pirate/releases/tag/v.test2

USBEprom commented 3 years ago

@gdamjan

Thank you Sir, really good!

gdamjan commented 3 years ago

here are test bootloaders https://github.com/gdamjan/Bus_Pirate/releases/tag/b.test

gdamjan commented 2 years ago

I'm gonna close this PR. It just annoys me in the open PRs list