https://github.com/husarnet/husarnet-arduino-builder
Arduino/PIO Husarnet library builder
https://github.com/husarnet/husarnet-arduino-builder
Last synced: 3 months ago
JSON representation
Arduino/PIO Husarnet library builder
- Host: GitHub
- URL: https://github.com/husarnet/husarnet-arduino-builder
- Owner: husarnet
- Created: 2024-07-25T12:38:21.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-03T08:08:54.000Z (almost 2 years ago)
- Last Synced: 2025-03-05T17:42:56.655Z (over 1 year ago)
- Language: Shell
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# husarnet-arduino-builder
This repository compiles and releases Arduino and PlatformIO Husarnet libraries. Resulting files can be found in the [husarnet-esp32-arduino](https://github.com/husarnet/husarnet-esp32-arduino) and [husarnet-esp32-platformio](https://github.com/husarnet/husarnet-esp32-platformio) repositories and in Arduino and PIO package registries.
## Architecture
In the root of the repository there are 4 folders used in the build process:
* `util/` - contains scripts used to perform all required actions in the release process
* `esp32-arduino-lib-builder` - submodule containing ESP32 Arduino builder, used to create prebuilt Husarnet libraries
* `husarnet-esp32-arduino` - submodule containing generated Husarnet ESP32 Arduino library
* `husarnet-esp32-platformio` - submodule containing generated Husarnet ESP32 PlatformIO library
Husarnet library is built from [the ESP-IDF component](https://github.com/husarnet/esp_husarnet/tree/master). Currently the builder selects latest stable released version on the ESP Registry. All core Husarnet code is taken from ESP-IDF port resulting in the same codebase across frameworks.
## Steps
The release process is automated and involves the following steps:
### Build
```
util/build.sh full
```
This script ensures that we have the latest version of the ESP32 Arduino Lib Builder. It optimises the `idf_component.yml` file to speed up the build and copies the output artifacts to library folders.
It can be run either in the `full` mode, which will download all components and toolchain files (very slow during first run) or in the `local_deps` mode, which will use the locally available ESP-IDF toolchain (needs to be sourced beforehand) and does not build as many unneccessary files, including the Arduino component as the full mode. Main drawback is possible incompatibility of the generated library with the Arduino IDE. Should be used for testing purposes only.
### (Optionally) Edit library files
Changes to the files in libraries should be done after the build step. Please note that currently `include` and `src` folders are removed and replaced with the ones from the ESP32 Arduino Lib Builder by the `util/build.sh` script.
### Bump version
```
util/version.sh get
util/version.sh set {arduino/pio/all} X.X.X
util/version.sh bump {arduino/pio/all} {major/minor/patch/prerelease}
```
This script allows to fetch, set and bump the version of the Arduino/PlatformIO Husarnet library. It will update the version in both libraries manifest files. Usually running the `bump all patch` command is enough.
### Release
```
util/release.sh {arduino/pio/all}
```
This script will release the Husarnet library to the PlatformIO package registry and tag new release in the Arduino library repository.
## Requirements
Clone the repository:
```
git clone --recurse-submodules
```
### Packages and libraries
Run:
```
sudo apt install python3 python3-pip jq gh
```
```
pip install -r requirements.txt
```
### PlatformIO
Is only required to release the PlatformIO library.
Could be installed via [pip](https://docs.platformio.org/en/latest/core/installation.html#python-package-manager) or a [installer script](https://docs.platformio.org/en/latest/core/installation.html#installer-script). Follow official instructions.
Alternatively, you can run `util/release.sh` script from the CLI bundled with the full VSCode PlatformIO extension, launched via `>PlatformIO: Open PlatformIO Core CLI` command.
### Service login
To release the Arduino library, you need to be logged in to the GitHub CLI. Run the following command and follow the instructions:
```
gh auth login
```
Uploading libraries to the PlatformIO registry also requires authentication. Run the following command and follow the instructions:
```
pio account login
```
## TODO
- [ ] Output library size optimization
- [ ] Verify that the version has been bumped before releasing