From 25aaa0da522d72e2de2535dd7aafdd8749dc0e84 Mon Sep 17 00:00:00 2001 From: Jorge Ramirez Date: Mon, 3 Jun 2024 11:28:52 -0700 Subject: [PATCH 1/4] Added more info on WiFi configs --- docs/Meadow/Meadow.Cloud/CI_CD/index.md | 27 +++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/docs/Meadow/Meadow.Cloud/CI_CD/index.md b/docs/Meadow/Meadow.Cloud/CI_CD/index.md index 8c285c748..a2ef31523 100644 --- a/docs/Meadow/Meadow.Cloud/CI_CD/index.md +++ b/docs/Meadow/Meadow.Cloud/CI_CD/index.md @@ -5,7 +5,7 @@ sidebar_label: GitHub Actions Publisher subtitle: Getting started --- -With GitHub Actions, you can automate the complete process of building, uploading and publishing Meadow MPAK files to Meadow.Cloud using [`meadow-cloud-package-upload`](https://github.com/WildernessLabs/meadow-cloud-package-upload) and [`meadow-cloud-package-publish`](https://github.com/WildernessLabs/meadow-cloud-package-publish) actions. It provides an integrated solution for managing the deployment pipeline of Meadow-based applications. +With GitHub Actions, you can automate the complete process of building, uploading and publishing Meadow MPAK files to Meadow.Cloud using [`Meadow.Cloud Package Upload`](https://github.com/marketplace/actions/meadow-cloud-package-upload) and [`Meadow.Cloud Package Publish`](https://github.com/marketplace/actions/meadow-cloud-package-publish) GitHub Actions. It provides an integrated solution for managing the deployment pipeline of Meadow-based applications. ## Ensure your Meadow device receives OTA Updates @@ -29,9 +29,26 @@ You'll also need the `Organization ID`. Click on your profile and select **Your ![Get organization ID](wildernesslabs-organization-id.png) +### Step 3 - Setting up WiFi config file + +Once you have your hardware and app deployed and connected to a WiFI network to listen for OTA updates, you need to update the `wifi.config.yml` and replace the credentials with GitHub Actions variables: + +```yml +# WiFi network credentials +Credentials: + + # WiFi SSID + Ssid: {{CONFIG_WIFI_SSID}} + + # WiFi Password + Password: {{CONFIG_WIFI_PASS}} +``` + +That way you dont need to have hard-coded WiFi credentials inside your application. Instead, you can create repository variables, and the GitHub Actions Publisher will replace them in the upload pipeline. + ### Step 3 - Add Repository Secrets for your API Key and WiFi credentials -So you dont check-in any WiFi credentials nor API keys, you can create repository secrets and add them there. We'll reference them later on the GitHub Actions workflow script. +Create repository secrets to store your WiFi credentials and the API Key. We'll reference them later on the GitHub Actions workflow script. In the repo page, go to the **Settings** tab, look **Secrets and variables** settings under the **Security** section, and enter the repository secrets for WiFi credentials and API Key. @@ -77,6 +94,12 @@ jobs: metadata: "metadata part of my publish" # Optional, set this to the desired metadata for publish if required ``` +:::info +Things to note: + - You can access secrets variables by doing `${{ secrets.VARIABLE_NAME }}` + - In the `configs` at the **Build + Upload** step, make sure the SSID and Password variables names match to the ones given in the `wifi.config.yml` file. +::: + Make sure to paste your ``Organization ID`` and ``Collection ID`` in the corresponding fields. ### Step 5 - Publish an update From 0b1ba2ad2f1d0a66a20d4df00d463e5b707b0cd9 Mon Sep 17 00:00:00 2001 From: Jorge Ramirez Date: Mon, 3 Jun 2024 15:21:56 -0700 Subject: [PATCH 2/4] Add clarification on config files and setup (wifi is optional) --- docs/Meadow/Meadow.Cloud/CI_CD/index.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/Meadow/Meadow.Cloud/CI_CD/index.md b/docs/Meadow/Meadow.Cloud/CI_CD/index.md index a2ef31523..448d3ad6e 100644 --- a/docs/Meadow/Meadow.Cloud/CI_CD/index.md +++ b/docs/Meadow/Meadow.Cloud/CI_CD/index.md @@ -31,6 +31,10 @@ You'll also need the `Organization ID`. Click on your profile and select **Your ### Step 3 - Setting up WiFi config file +:::caution +This guide is using an example thats using a WiFi network connection. If your project is using Ethernet or Cellular to listen for Over-the-Air Updates, you can skip this step and continue on Step 3. +::: + Once you have your hardware and app deployed and connected to a WiFI network to listen for OTA updates, you need to update the `wifi.config.yml` and replace the credentials with GitHub Actions variables: ```yml @@ -44,13 +48,13 @@ Credentials: Password: {{CONFIG_WIFI_PASS}} ``` -That way you dont need to have hard-coded WiFi credentials inside your application. Instead, you can create repository variables, and the GitHub Actions Publisher will replace them in the upload pipeline. +That way you dont need to have hard-coded WiFi credentials inside your application. Instead, you can create repository variables, and the **GitHub Actions Publisher** will replace them in the upload pipeline. -### Step 3 - Add Repository Secrets for your API Key and WiFi credentials +### Step 3 - Add Repository Secrets for sensitive data -Create repository secrets to store your WiFi credentials and the API Key. We'll reference them later on the GitHub Actions workflow script. +Create repository secrets to store your sensitive information like WiFi credentials (if you're using WiFi), API Keys, etc. You'll reference them later when writing the GitHub Actions workflow script. -In the repo page, go to the **Settings** tab, look **Secrets and variables** settings under the **Security** section, and enter the repository secrets for WiFi credentials and API Key. +In the repo page, go to the **Settings** tab, look **Secrets and variables** settings under the **Security** section, and enter the repository secrets for your private data such as WiFi credentials, API keys, etc. ![Add WiFi and API Key secrets](wildernesslabs-secrets.jpg) @@ -97,7 +101,7 @@ jobs: :::info Things to note: - You can access secrets variables by doing `${{ secrets.VARIABLE_NAME }}` - - In the `configs` at the **Build + Upload** step, make sure the SSID and Password variables names match to the ones given in the `wifi.config.yml` file. + - In the `configs` field at the **Build + Upload** step, you can enter a list of repository variables along with values that will be replaced during the build and upload pipeline. In this example guide, we're referencing the SSID and Password variables names that match to the ones given in the `wifi.config.yml` file. ::: Make sure to paste your ``Organization ID`` and ``Collection ID`` in the corresponding fields. From b5ddd8f2c226d7ffd28150360d859b00b4d89b22 Mon Sep 17 00:00:00 2001 From: Jorge Ramirez Date: Mon, 3 Jun 2024 15:25:21 -0700 Subject: [PATCH 3/4] Fix step numbering --- docs/Meadow/Meadow.Cloud/CI_CD/index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/Meadow/Meadow.Cloud/CI_CD/index.md b/docs/Meadow/Meadow.Cloud/CI_CD/index.md index 448d3ad6e..81a465a6b 100644 --- a/docs/Meadow/Meadow.Cloud/CI_CD/index.md +++ b/docs/Meadow/Meadow.Cloud/CI_CD/index.md @@ -29,7 +29,7 @@ You'll also need the `Organization ID`. Click on your profile and select **Your ![Get organization ID](wildernesslabs-organization-id.png) -### Step 3 - Setting up WiFi config file +### Step 3 - Setting up WiFi config file (if using WiFi connectivity) :::caution This guide is using an example thats using a WiFi network connection. If your project is using Ethernet or Cellular to listen for Over-the-Air Updates, you can skip this step and continue on Step 3. @@ -50,7 +50,7 @@ Credentials: That way you dont need to have hard-coded WiFi credentials inside your application. Instead, you can create repository variables, and the **GitHub Actions Publisher** will replace them in the upload pipeline. -### Step 3 - Add Repository Secrets for sensitive data +### Step 4 - Add Repository Secrets for sensitive data Create repository secrets to store your sensitive information like WiFi credentials (if you're using WiFi), API Keys, etc. You'll reference them later when writing the GitHub Actions workflow script. @@ -58,7 +58,7 @@ In the repo page, go to the **Settings** tab, look **Secrets and variables** set ![Add WiFi and API Key secrets](wildernesslabs-secrets.jpg) -### Step 4 - Create a GitHub action Workflow +### Step 5 - Create a GitHub action Workflow In your repository, add a `.github` folder if you havent already and inside add a `workflows` folder. Finally, create a workflow file, `main.yml` for example. Copy the following code block: @@ -106,7 +106,7 @@ Things to note: Make sure to paste your ``Organization ID`` and ``Collection ID`` in the corresponding fields. -### Step 5 - Publish an update +### Step 6 - Publish an update If everything is configured properly, you can finally publish app updates from GitHub Actions. Head over to your repo, select the **Actions** tab, and select the workflow you just created. Click the **Run workflow** button to publish an update. From 67ac434524b021e38e4856db87798ef525bce228 Mon Sep 17 00:00:00 2001 From: Jorge Ramirez Date: Mon, 3 Jun 2024 15:26:33 -0700 Subject: [PATCH 4/4] Typo --- docs/Meadow/Meadow.Cloud/CI_CD/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Meadow/Meadow.Cloud/CI_CD/index.md b/docs/Meadow/Meadow.Cloud/CI_CD/index.md index 81a465a6b..89fc46162 100644 --- a/docs/Meadow/Meadow.Cloud/CI_CD/index.md +++ b/docs/Meadow/Meadow.Cloud/CI_CD/index.md @@ -32,7 +32,7 @@ You'll also need the `Organization ID`. Click on your profile and select **Your ### Step 3 - Setting up WiFi config file (if using WiFi connectivity) :::caution -This guide is using an example thats using a WiFi network connection. If your project is using Ethernet or Cellular to listen for Over-the-Air Updates, you can skip this step and continue on Step 3. +This guide is using an example thats using a WiFi network connection. If your project is using Ethernet or Cellular to listen for Over-the-Air Updates, you can skip this step and continue on Step 4. ::: Once you have your hardware and app deployed and connected to a WiFI network to listen for OTA updates, you need to update the `wifi.config.yml` and replace the credentials with GitHub Actions variables: