Skip to content

Commit

Permalink
Merge pull request #32 from groundlight/credentials-refactor-fix
Browse files Browse the repository at this point in the history
updated workflows to fix issues exposed by credentials-refactor merge
  • Loading branch information
positavi authored Dec 17, 2023
2 parents e8d1330 + 46c85a6 commit c81e563
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/make_binaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: PlatformIO CI

on:
push:
branches:
- main

jobs:
build:
Expand All @@ -23,9 +21,19 @@ jobs:
- name: Install PlatformIO Core
run: pip install --upgrade platformio

- name: Create credentials.h for build
run: cp src/credentials_template.h src/credentials.h

- name: Build PlatformIO Project
run: pio run


deploy_release:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: build
steps:

- name: Copy binaries to /firmware
run: bash copy_firmware.sh

Expand Down
17 changes: 10 additions & 7 deletions src/credentials_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/* template file for preloading credentials instead of reading from the file system
* only applicable for [env:demo-unit-preloaded]
*
* to use this file, copy this template to "credentials.h" and fill in the applicable values.
* to use this file, copy this template to "credentials.h" and uncomment/fill in the applicable values.
* the list below is non-exhaustive and additional options can be added as needed.
* this will override anything in the file system on every startup.
*/
Expand All @@ -13,17 +13,20 @@
void set_preferences(Preferences preferences);

void set_preferences(Preferences preferences) {
// A non-exhaustive list of preferences for the ESP32

preferences.begin("config");
preferences.putString("ssid", "");
preferences.putString("password", "");
preferences.putString("det_id", "");
preferences.putString("api_key", "");
preferences.putInt("query_delay", 600);

// A non-exhaustive list of preferences for the ESP32
// preferences.putString("ssid", "");
// preferences.putString("password", "");
// preferences.putString("det_id", "");
// preferences.putString("api_key", "");
// preferences.putInt("query_delay", 600);
// preferences.putString("email", "");
// preferences.putString("emailEndpoint", "");
// preferences.putString("emailKey", "");
// preferences.putString("emailHost", "");

preferences.end();
}

0 comments on commit c81e563

Please sign in to comment.