From 6857d134007426218bd69be9c3b1671106954da8 Mon Sep 17 00:00:00 2001 From: Riccardo Balbo Date: Sun, 7 Jul 2024 14:15:40 +0200 Subject: [PATCH] package --- .github/workflows/build-test.yml | 24 ++++++++++++++++++++ .github/workflows/publish-package.yml | 32 +++++++++++++++++++++++++++ library.json | 4 ++-- platformio.ini | 6 ++--- 4 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/build-test.yml create mode 100644 .github/workflows/publish-package.yml diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 0000000..97cb23c --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,24 @@ +name: Build + +on: + push: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install PlatformIO + run: pip install -U platformio + + - name: Build + run: | + pio run -e ESP32TestNip01 + pio run -e ESP32TestNip04 + pio run -e ESP32TestNWC \ No newline at end of file diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml new file mode 100644 index 0000000..6d84209 --- /dev/null +++ b/.github/workflows/publish-package.yml @@ -0,0 +1,32 @@ +name: Publish Package to PlatformIO Registry + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install PlatformIO + run: pip install -U platformio + + - name: Update version in library.json + run: | + VERSION=${GITHUB_REF#refs/tags/} + echo "Build version is $VERSION" + sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" library.json + cat library.json + + - name: Publish to PlatformIO Registry + env: + PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }} + run: | + pio package publish --no-interactive \ No newline at end of file diff --git a/library.json b/library.json index cdc76e2..b1cb063 100644 --- a/library.json +++ b/library.json @@ -3,7 +3,7 @@ { "maintainer": true, "name": "rblb", - "url": "https://github.com/riccardobl/nostrduino" + "url": "https://github.com/riccardobl" }, { "maintainer": false, @@ -28,7 +28,7 @@ }, "version": "1.2.0", "dependencies": { - "ArduinoJson": "^6.21.1", + "ArduinoJson": "^7.1.0", "uBitcoin": "^0.2.0", "WebSockets": "^2.4.1" } diff --git a/platformio.ini b/platformio.ini index c8353e2..a128e27 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,7 +11,7 @@ build_src_filter = +<../examples/ESP32TestNip01/> +<../src/> lib_deps = ArduinoJson@^7.1.0 uBitcoin@^0.2.0 - WebSockets@^2.3.5 + WebSockets@^2.4.1 Wire marcoschwartz/LiquidCrystal_I2C@^1.1.4 @@ -25,7 +25,7 @@ build_src_filter = +<../src/> +<../examples/ESP32TestNip04/> lib_deps = ArduinoJson@^7.1.0 uBitcoin@^0.2.0 - WebSockets@^2.3.5 + WebSockets@^2.4.1 Wire marcoschwartz/LiquidCrystal_I2C@^1.1.4 @@ -38,6 +38,6 @@ build_src_filter = +<../src/> +<../examples/ESP32TestNWC/> lib_deps = ArduinoJson@^7.1.0 uBitcoin@^0.2.0 - WebSockets@^2.3.5 + WebSockets@^2.4.1 Wire marcoschwartz/LiquidCrystal_I2C@^1.1.4