-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from qube-ai/v1.1.0
V1.1.0
- Loading branch information
Showing
7 changed files
with
138 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: PR Test (check if code compiles) | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache pip | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Cache PlatformIO | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.platformio | ||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
|
||
- name: Install PlatformIO | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade platformio | ||
- name: Install dependencies | ||
working-directory: ./examples/simple | ||
run: pio pkg install | ||
|
||
- name: Build | ||
working-directory: ./examples/simple | ||
run: pio run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Release Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache pip | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Cache PlatformIO | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.platformio | ||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
|
||
- name: Install PlatformIO | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade platformio | ||
- name: Install dependencies | ||
working-directory: ./examples/simple | ||
run: pio pkg install | ||
|
||
- name: Build | ||
working-directory: ./examples/simple | ||
run: pio run | ||
|
||
- name: create env variable for lib version from library.json | ||
id: lib_version | ||
run: echo "::set-output name=version::$(cat library.json | grep "version" | cut -d '"' -f 4)" | ||
|
||
- name: Create Github Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: true | ||
tag: "v${{ steps.lib_version.outputs.version }}" | ||
token: ${{ secrets.TOKEN_GITHUB }} | ||
name: "v${{ steps.lib_version.outputs.version }}" | ||
body: "This is a production build for the v${{ steps.lib_version.outputs.version }}. Changelog will be added in future versions." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[env:release] | ||
platform = espressif8266 | ||
board = esp12e | ||
framework = arduino | ||
lib_deps = | ||
; https://github.com/qube-ai/tiny-webthing.git | ||
file://../../ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include <Arduino.h> | ||
#include <AsymJwt.h> | ||
|
||
|
||
void setup() | ||
{ | ||
Serial.begin(9600); | ||
Serial.println("Reading private ket...."); | ||
while (!AsymJWT::readPrivKey("/private-key.der")) | ||
{ | ||
Serial.println("Failed to read private key. Retrying in 2 seconds"); | ||
delay(2000); | ||
} | ||
} | ||
|
||
|
||
void loop() | ||
{ | ||
time_t iat = time(nullptr); | ||
String payload = "{\"iat\":" + String(iat) + ",\"exp\":" + String(iat + 300) + ",\"thing_id\":\"" + "THING_ID" + "\"}"; | ||
Serial.println(AsymJWT::generateJwt(payload)); | ||
delay(200000); | ||
Serial.println("Refreshing JWT."); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
#include "AsymJwt.h" | ||
|
||
#include "LittleFS.h" | ||
#include "WiFiClientSecureBearSSL.h" | ||
|
||
NN_DIGIT priv_key[9]; | ||
|
||
|