diff --git a/.github/workflows/arduino-lint.yml b/.github/workflows/arduino-lint.yml new file mode 100644 index 0000000..582ffd9 --- /dev/null +++ b/.github/workflows/arduino-lint.yml @@ -0,0 +1,38 @@ +name: Arduino Library Lint + +on: + pull_request: + push: + branches: + - main + tags: + - "v*" + +permissions: + contents: read + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Check tag and library version + if: github.ref_type == 'tag' + shell: bash + run: | + library_version="$(sed -n 's/^version=//p' library.properties)" + tag_version="${GITHUB_REF_NAME#v}" + if [[ -z "${library_version}" || "${tag_version}" != "${library_version}" ]]; then + echo "Tag ${GITHUB_REF_NAME} does not match library version ${library_version}." >&2 + exit 1 + fi + + - name: Run Arduino Lint + uses: arduino/arduino-lint-action@v3 + with: + compliance: strict + library-manager: submit + project-type: library + recursive: false diff --git a/README.md b/README.md index a691e40..17097e4 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,26 @@ -# RadioCore Library +# RadioCore_Kit -RadioCore Library is the shared Arduino library for RadioCore series hardware. +RadioCore_Kit is the shared Arduino library for RadioCore series hardware. It provides compile-time board configuration used by portable, board-adaptive examples. ## Installation -Clone or copy this repository into the `libraries` directory of your Arduino -sketchbook, then restart the Arduino IDE if it is already running. +Open Library Manager in the Arduino IDE, search for `RadioCore_Kit`, and select +**Install**. Arduino CLI users can install the library with: + +```sh +arduino-cli lib install RadioCore_Kit +``` + +For development versions that have not been released, clone or copy this +repository into the `libraries` directory of your Arduino sketchbook, then +restart the Arduino IDE if it is already running. Sketches can include the library with: ```cpp -#include +#include ``` ## Dependencies @@ -26,7 +34,7 @@ The library declares these Arduino dependencies: - `ESP32Servo` for ESP32-based RadioCore boards Dependency-aware Arduino tools can install these libraries automatically. -RadioCore Library does not copy, wrap, or re-export them. +RadioCore_Kit does not copy, wrap, or re-export them. The Heltec nRF52 board package supplies the Arduino official `Servo` library used by `Servo_Control` on RC52; no separate Servo library installation is @@ -40,7 +48,7 @@ the Arduino Library Manager version of `GFX Library for Arduino`. ## Examples -Open the examples from `File > Examples > RadioCore Library` in the Arduino +Open the examples from `File > Examples > RadioCore_Kit` in the Arduino IDE. Board configuration macros select the supported pins and peripherals at compile time. @@ -84,10 +92,10 @@ nRF52 peripheral APIs used by RC32, RCC6, and RC52. A board with a different I2C, ADC, SPI, or servo API may require a new architecture path in the relevant example. -Unknown boards can still include `RadioCore.h`. All example capability macros +Unknown boards can still include `RadioCore_Kit.h`. All example capability macros default to disabled, and an unsupported example reports its missing capability during preprocessing. ## License -RadioCore Library is released under the MIT License. See [LICENSE](LICENSE). +RadioCore_Kit is released under the MIT License. See [LICENSE](LICENSE). diff --git a/docs/CONTEXT.md b/docs/CONTEXT.md index 640f753..748d122 100644 --- a/docs/CONTEXT.md +++ b/docs/CONTEXT.md @@ -5,9 +5,9 @@ series hardware. ## Language -**RadioCore Library**: +**RadioCore_Kit**: The shared Arduino package for the RadioCore hardware family. -_Avoid_: sensor driver bundle, full board support package +_Avoid_: RadioCore Library, sensor driver bundle, full board support package **Sensor I2C**: The board-designated I2C bus used by RadioCore examples for external sensors. diff --git a/docs/RELEASING.md b/docs/RELEASING.md new file mode 100644 index 0000000..b13fac2 --- /dev/null +++ b/docs/RELEASING.md @@ -0,0 +1,27 @@ +# Releasing RadioCore_Kit + +RadioCore_Kit uses Semantic Versioning. The version in `library.properties` is +the release version and each release tag must use the matching `vX.Y.Z` form. + +## Release procedure + +1. Update `version` in `library.properties` and prepare the GitHub release notes. +2. Run Arduino Lint with strict compliance and the applicable Library Manager + mode. Use `submit` until the library is accepted into the registry, then use + `update` for all later releases. +3. Confirm `git diff --check` passes and the tag name without its leading `v` + exactly matches the version in `library.properties`. +4. Merge the verified release commit to `main`. +5. Create and push an annotated `vX.Y.Z` tag on that commit, then create a + non-draft, non-prerelease GitHub Release from the tag. Use GitHub's generated + source archives; do not attach a custom library ZIP. +6. Check the Arduino Library Manager indexer logs for the repository. + +The release gate is static only. It does not compile the examples or prove +behavior on RC32, RCC6, RC52, or attached hardware. Release notes must state +this limitation. + +Before the first version is accepted into the Library Manager index, a rejected +tag may be removed and recreated after fixing the release. Once a version has +entered the index, never move or recreate its tag; publish a new patch version +instead. diff --git a/examples/BH1750_Read/BH1750_Read.ino b/examples/BH1750_Read/BH1750_Read.ino index 809dbe9..1bcccd3 100644 --- a/examples/BH1750_Read/BH1750_Read.ino +++ b/examples/BH1750_Read/BH1750_Read.ino @@ -1,6 +1,6 @@ #include #include -#include +#include #if !RADIOCORE_HAS_SENSOR_I2C #error "BH1750_Read requires a RadioCore SENSOR_I2C board configuration." diff --git a/examples/CH01_Read/CH01_Read.ino b/examples/CH01_Read/CH01_Read.ino index 45b5e77..4b6a2d9 100644 --- a/examples/CH01_Read/CH01_Read.ino +++ b/examples/CH01_Read/CH01_Read.ino @@ -1,5 +1,5 @@ #include -#include +#include #if !RADIOCORE_HAS_CH01_ADC #error "CH01_Read requires a RadioCore CH01 ADC board configuration." diff --git a/examples/CO01_Read/CO01_Read.ino b/examples/CO01_Read/CO01_Read.ino index c884eb6..4299afc 100644 --- a/examples/CO01_Read/CO01_Read.ino +++ b/examples/CO01_Read/CO01_Read.ino @@ -1,5 +1,5 @@ #include -#include +#include #if !RADIOCORE_HAS_CO01_ADC #error "CO01_Read requires a RadioCore CO01 ADC board configuration." diff --git a/examples/Motor_Control/Motor_Control.ino b/examples/Motor_Control/Motor_Control.ino index a5133aa..6496cac 100644 --- a/examples/Motor_Control/Motor_Control.ino +++ b/examples/Motor_Control/Motor_Control.ino @@ -7,7 +7,7 @@ * direction for later runs. RCC6 GPIO3/GPIO4 overlap NV3001B DC/SCK. */ #include -#include +#include #if !RADIOCORE_HAS_MOTOR_CONTROL #error "Motor_Control requires a RadioCore motor control board configuration." diff --git a/examples/NV3001B_Display/NV3001B_Display.ino b/examples/NV3001B_Display/NV3001B_Display.ino index 240f6d7..b8ba172 100644 --- a/examples/NV3001B_Display/NV3001B_Display.ino +++ b/examples/NV3001B_Display/NV3001B_Display.ino @@ -5,7 +5,7 @@ * https://github.com/Quency-D/Arduino_GFX */ #include -#include +#include #if !RADIOCORE_HAS_NV3001B_DISPLAY #error "NV3001B_Display requires a RadioCore NV3001B board configuration." diff --git a/examples/Relay_Control/Relay_Control.ino b/examples/Relay_Control/Relay_Control.ino index 91ee6dc..99a70ba 100644 --- a/examples/Relay_Control/Relay_Control.ino +++ b/examples/Relay_Control/Relay_Control.ino @@ -11,7 +11,7 @@ #endif #include -#include +#include #if !RADIOCORE_HAS_RELAY_CONTROL #error "Relay_Control requires a RadioCore relay control board configuration." diff --git a/examples/Servo_Control/Servo_Control.ino b/examples/Servo_Control/Servo_Control.ino index 0db7e18..3ec41a1 100644 --- a/examples/Servo_Control/Servo_Control.ino +++ b/examples/Servo_Control/Servo_Control.ino @@ -8,7 +8,7 @@ * PWM pins overlap Motor_Control on all boards and NV3001B signals on RCC6. */ #include -#include +#include #if !RADIOCORE_HAS_SERVO_CONTROL #error "Servo_Control requires a RadioCore servo control board configuration." diff --git a/examples/Soil_Moisture_Read/Soil_Moisture_Read.ino b/examples/Soil_Moisture_Read/Soil_Moisture_Read.ino index d6c6808..4e2d2e3 100644 --- a/examples/Soil_Moisture_Read/Soil_Moisture_Read.ino +++ b/examples/Soil_Moisture_Read/Soil_Moisture_Read.ino @@ -1,5 +1,5 @@ #include -#include +#include #if !RADIOCORE_HAS_SOIL_MOISTURE_ADC #error "Soil_Moisture_Read requires a RadioCore soil moisture ADC board configuration." diff --git a/examples/VO01_Read/VO01_Read.ino b/examples/VO01_Read/VO01_Read.ino index 0cf037f..c99387b 100644 --- a/examples/VO01_Read/VO01_Read.ino +++ b/examples/VO01_Read/VO01_Read.ino @@ -1,5 +1,5 @@ #include -#include +#include #if !RADIOCORE_HAS_VO01_ADC #error "VO01_Read requires a RadioCore VO01 ADC board configuration." diff --git a/examples/WS2812/WS2812.ino b/examples/WS2812/WS2812.ino index dcc7e8a..a8d9444 100644 --- a/examples/WS2812/WS2812.ino +++ b/examples/WS2812/WS2812.ino @@ -9,7 +9,7 @@ #define LED_COUNT 30 #include -#include +#include #if !RADIOCORE_HAS_WS2812 #error "WS2812 requires a RadioCore WS2812 board configuration." diff --git a/library.properties b/library.properties index 32b9e9a..6a68bc6 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ -name=RadioCore Library -version=0.0.1 +name=RadioCore_Kit +version=1.0.0 author=Heltec Automation maintainer=Heltec Automation sentence=Arduino library for RadioCore series hardware. @@ -7,5 +7,5 @@ paragraph=Provides compile-time board configuration for RadioCore hardware and d category=Device Control url=https://github.com/HelTecAutomation/RadioCore_Library architectures=* -includes=RadioCore.h +includes=RadioCore_Kit.h depends=Adafruit BME280 Library, BH1750 (>=1.3.0), Adafruit NeoPixel, ESP32Servo diff --git a/src/RadioCore.h b/src/RadioCore.h deleted file mode 100644 index 1084148..0000000 --- a/src/RadioCore.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef RADIOCORE_H -#define RADIOCORE_H - -#include "RadioCoreBoardConfig.h" - -#endif // RADIOCORE_H diff --git a/src/RadioCore_Kit.h b/src/RadioCore_Kit.h new file mode 100644 index 0000000..9f66324 --- /dev/null +++ b/src/RadioCore_Kit.h @@ -0,0 +1,6 @@ +#ifndef RADIOCORE_KIT_H +#define RADIOCORE_KIT_H + +#include "RadioCoreBoardConfig.h" + +#endif // RADIOCORE_KIT_H