From 01703000479ab0b53bd755ec481a3b68f9771379 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Mon, 21 Oct 2024 21:24:15 -0700 Subject: [PATCH 01/52] Trying again but this time with secrets handling --- .github/workflows/build.yml | 6 ++++++ .gitignore | 3 +++ 2 files changed, 9 insertions(+) create mode 100644 .gitignore diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b7319f..fb95cb8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,6 +80,12 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4.2.1 + - name: Configure secrets.yaml file + run: | + python -c "import os; file = open('albionboxes/secrets.yaml', 'w'); file.write(os.environ['FOO']); file.close()" + shell: bash + env: + FOO: ${{secrets.FOO}} - name: Replace project version run: | sed -i "s/version: dev/version: ${{ needs.prepare.outputs.version }}/g" ${{ matrix.file }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..08302ef --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.DS_Store +.idea + From 7193601210334f5326ab330246bd5ef3c8ff542f Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Mon, 21 Oct 2024 21:34:32 -0700 Subject: [PATCH 02/52] Seeing if this might work --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb95cb8..d364568 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,10 +82,11 @@ jobs: uses: actions/checkout@v4.2.1 - name: Configure secrets.yaml file run: | - python -c "import os; file = open('albionboxes/secrets.yaml', 'w'); file.write(os.environ['FOO']); file.close()" + python -c "import os; import yaml; secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password']); secrets_file = open('albionboxes/secrets.yaml', 'w'); secrets_file.write(secrets_data); secrets_file.close()" shell: bash env: - FOO: ${{secrets.FOO}} + wifi_ssid: ${{secrets.wifi_ssid}} + wifi_password: ${{secrets.wifi_password}} - name: Replace project version run: | sed -i "s/version: dev/version: ${{ needs.prepare.outputs.version }}/g" ${{ matrix.file }} From 9870f20b404a47312961301ba4e25a6847065173 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Mon, 21 Oct 2024 21:41:50 -0700 Subject: [PATCH 03/52] One last try --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d364568..8977c5d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,7 +82,7 @@ jobs: uses: actions/checkout@v4.2.1 - name: Configure secrets.yaml file run: | - python -c "import os; import yaml; secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password']); secrets_file = open('albionboxes/secrets.yaml', 'w'); secrets_file.write(secrets_data); secrets_file.close()" + python -c "import os; import yaml; secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" shell: bash env: wifi_ssid: ${{secrets.wifi_ssid}} From 18ddc2e9c55251fada0ddb770f18b47183fb3073 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Mon, 21 Oct 2024 21:45:12 -0700 Subject: [PATCH 04/52] Might have found another issue --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8977c5d..92b582d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,11 +82,12 @@ jobs: uses: actions/checkout@v4.2.1 - name: Configure secrets.yaml file run: | - python -c "import os; import yaml; secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" + python -c "import os; import yaml; secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" shell: bash env: wifi_ssid: ${{secrets.wifi_ssid}} wifi_password: ${{secrets.wifi_password}} + encryption_key: ${{secrets.encryption_key}} - name: Replace project version run: | sed -i "s/version: dev/version: ${{ needs.prepare.outputs.version }}/g" ${{ matrix.file }} From d35df4591712bbacb951eaf1a2299f7ab90f3e11 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Mon, 21 Oct 2024 21:53:45 -0700 Subject: [PATCH 05/52] Getting closer to a useful workflow --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 92b582d..9ea797c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,12 +82,13 @@ jobs: uses: actions/checkout@v4.2.1 - name: Configure secrets.yaml file run: | - python -c "import os; import yaml; secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" + python -c "import os; import yaml; secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key'], ota_password=os.environ['ota_password']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" shell: bash env: wifi_ssid: ${{secrets.wifi_ssid}} wifi_password: ${{secrets.wifi_password}} encryption_key: ${{secrets.encryption_key}} + ota_password: ${{secrets.ota_password}} - name: Replace project version run: | sed -i "s/version: dev/version: ${{ needs.prepare.outputs.version }}/g" ${{ matrix.file }} From db993cb08841a2da5f6b48f917d58761f95bbf01 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Mon, 21 Oct 2024 21:58:36 -0700 Subject: [PATCH 06/52] Too much --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ea797c..662d986 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -89,6 +89,10 @@ jobs: wifi_password: ${{secrets.wifi_password}} encryption_key: ${{secrets.encryption_key}} ota_password: ${{secrets.ota_password}} + - name: DEBUG echo the secrets.yaml file + run: | + echo albionboxes/secrets.yaml + shell: bash - name: Replace project version run: | sed -i "s/version: dev/version: ${{ needs.prepare.outputs.version }}/g" ${{ matrix.file }} From 934c2413d0e76185c6fe135a7ee7184f51b00329 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Mon, 21 Oct 2024 22:00:41 -0700 Subject: [PATCH 07/52] Wrong command --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 662d986..63be0e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -91,7 +91,7 @@ jobs: ota_password: ${{secrets.ota_password}} - name: DEBUG echo the secrets.yaml file run: | - echo albionboxes/secrets.yaml + cat albionboxes/secrets.yaml shell: bash - name: Replace project version run: | From 8952c4d1e2a0a86467dfb2ae8980ed63b1d46f86 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Mon, 21 Oct 2024 22:07:54 -0700 Subject: [PATCH 08/52] Can I ever get this --- .github/workflows/build.yml | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 63be0e0..5a986b9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,26 @@ on: required: false type: string default: "" + wifi_ssid: + description: Combine all files into a single manifest under this name + required: true + type: string + default: "" + wifi_password: + description: Combine all files into a single manifest under this name + required: true + type: string + default: "" + encryption_key: + description: Combine all files into a single manifest under this name + required: true + type: string + default: "" + ota_password: + description: Combine all files into a single manifest under this name + required: true + type: string + default: "" outputs: version: @@ -85,10 +105,10 @@ jobs: python -c "import os; import yaml; secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key'], ota_password=os.environ['ota_password']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" shell: bash env: - wifi_ssid: ${{secrets.wifi_ssid}} - wifi_password: ${{secrets.wifi_password}} - encryption_key: ${{secrets.encryption_key}} - ota_password: ${{secrets.ota_password}} + wifi_ssid: ${{ inputs.wifi_ssid }} + wifi_password: ${{ inputs.wifi_password }} + encryption_key: ${{ inputs.encryption_key }} + ota_password: ${{ inputs.ota_password }} - name: DEBUG echo the secrets.yaml file run: | cat albionboxes/secrets.yaml From 65ebe2d8bad35a3e627720a592b192cb2ef7469c Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Mon, 21 Oct 2024 22:19:59 -0700 Subject: [PATCH 09/52] Trying yet again --- .github/workflows/build.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a986b9..4377d76 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,26 +32,23 @@ on: required: false type: string default: "" + secrets: wifi_ssid: description: Combine all files into a single manifest under this name required: true type: string - default: "" wifi_password: description: Combine all files into a single manifest under this name required: true type: string - default: "" encryption_key: description: Combine all files into a single manifest under this name required: true type: string - default: "" ota_password: description: Combine all files into a single manifest under this name required: true type: string - default: "" outputs: version: @@ -105,10 +102,10 @@ jobs: python -c "import os; import yaml; secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key'], ota_password=os.environ['ota_password']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" shell: bash env: - wifi_ssid: ${{ inputs.wifi_ssid }} - wifi_password: ${{ inputs.wifi_password }} - encryption_key: ${{ inputs.encryption_key }} - ota_password: ${{ inputs.ota_password }} + wifi_ssid: ${{ secrets.wifi_ssid }} + wifi_password: ${{ secrets.wifi_password }} + encryption_key: ${{ secrets.encryption_key }} + ota_password: ${{ secrets.ota_password }} - name: DEBUG echo the secrets.yaml file run: | cat albionboxes/secrets.yaml From a7b0f16a84acf0122b3b11012daa7927ef20721d Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Mon, 21 Oct 2024 22:21:26 -0700 Subject: [PATCH 10/52] What if this is closer --- .github/workflows/build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4377d76..2b7d481 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,19 +36,15 @@ on: wifi_ssid: description: Combine all files into a single manifest under this name required: true - type: string wifi_password: description: Combine all files into a single manifest under this name required: true - type: string encryption_key: description: Combine all files into a single manifest under this name required: true - type: string ota_password: description: Combine all files into a single manifest under this name required: true - type: string outputs: version: From 749b406520a4392db856bc893efe347eff8d823e Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Mon, 21 Oct 2024 22:30:09 -0700 Subject: [PATCH 11/52] That has to be enough --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b7d481..acb4644 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -95,7 +95,7 @@ jobs: uses: actions/checkout@v4.2.1 - name: Configure secrets.yaml file run: | - python -c "import os; import yaml; secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key'], ota_password=os.environ['ota_password']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" + python -c "import os; import yaml; print(os.environ); secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key'], ota_password=os.environ['ota_password']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" shell: bash env: wifi_ssid: ${{ secrets.wifi_ssid }} From 9b34f1969496823c3408daedce03d0621f6d5141 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Mon, 21 Oct 2024 22:40:40 -0700 Subject: [PATCH 12/52] Curious about this attempt --- .github/workflows/build.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index acb4644..6433e0d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,19 +32,19 @@ on: required: false type: string default: "" - secrets: - wifi_ssid: - description: Combine all files into a single manifest under this name - required: true - wifi_password: - description: Combine all files into a single manifest under this name - required: true - encryption_key: - description: Combine all files into a single manifest under this name - required: true - ota_password: - description: Combine all files into a single manifest under this name - required: true +# secrets: +# wifi_ssid: +# description: Combine all files into a single manifest under this name +# required: true +# wifi_password: +# description: Combine all files into a single manifest under this name +# required: true +# encryption_key: +# description: Combine all files into a single manifest under this name +# required: true +# ota_password: +# description: Combine all files into a single manifest under this name +# required: true outputs: version: From 9c81b1b337d7db9eef30201df7a051fef0fdfb27 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Mon, 21 Oct 2024 22:43:33 -0700 Subject: [PATCH 13/52] Curious now about this set up --- .github/workflows/build.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6433e0d..9aad5e4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,23 @@ on: required: false type: string default: "" + # FIXME: this should be a secret + wifi_ssid: + description: Combine all files into a single manifest under this name + required: true + type: string + wifi_password: + description: Combine all files into a single manifest under this name + required: true + type: string + encryption_key: + description: Combine all files into a single manifest under this name + required: true + type: string + ota_password: + description: Combine all files into a single manifest under this name + required: true + type: string # secrets: # wifi_ssid: # description: Combine all files into a single manifest under this name From cb85d7fcc3d8e83598e5fa6b6ee98600e97586cb Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Mon, 21 Oct 2024 22:46:29 -0700 Subject: [PATCH 14/52] Notes and another attempt --- .github/workflows/build.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9aad5e4..9155561 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -115,10 +115,15 @@ jobs: python -c "import os; import yaml; print(os.environ); secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key'], ota_password=os.environ['ota_password']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" shell: bash env: - wifi_ssid: ${{ secrets.wifi_ssid }} - wifi_password: ${{ secrets.wifi_password }} - encryption_key: ${{ secrets.encryption_key }} - ota_password: ${{ secrets.ota_password }} + # FIXME: this should be a secret + wifi_ssid: ${{ inputs.wifi_ssid }} + wifi_password: ${{ inputs.wifi_password }} + encryption_key: ${{ inputs.encryption_key }} + ota_password: ${{ inputs.ota_password }} +# wifi_ssid: ${{ secrets.wifi_ssid }} +# wifi_password: ${{ secrets.wifi_password }} +# encryption_key: ${{ secrets.encryption_key }} +# ota_password: ${{ secrets.ota_password }} - name: DEBUG echo the secrets.yaml file run: | cat albionboxes/secrets.yaml From 1bc2d3300ee7eeaeacf1431f28f71d6639b48702 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Mon, 21 Oct 2024 22:49:23 -0700 Subject: [PATCH 15/52] Trying to add another one --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9155561..cb89dfd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,6 +49,10 @@ on: description: Combine all files into a single manifest under this name required: true type: string + rufus_url: + description: Combine all files into a single manifest under this name + required: true + type: string # secrets: # wifi_ssid: # description: Combine all files into a single manifest under this name @@ -112,7 +116,7 @@ jobs: uses: actions/checkout@v4.2.1 - name: Configure secrets.yaml file run: | - python -c "import os; import yaml; print(os.environ); secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key'], ota_password=os.environ['ota_password']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" + python -c "import os; import yaml; print(os.environ); secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key'], ota_password=os.environ['ota_password'], rufus_url=os.environ['rufus_url']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" shell: bash env: # FIXME: this should be a secret @@ -120,6 +124,7 @@ jobs: wifi_password: ${{ inputs.wifi_password }} encryption_key: ${{ inputs.encryption_key }} ota_password: ${{ inputs.ota_password }} + rufus_url: ${{ inputs.rufus_url }} # wifi_ssid: ${{ secrets.wifi_ssid }} # wifi_password: ${{ secrets.wifi_password }} # encryption_key: ${{ secrets.encryption_key }} From 93958fc1f1483cdd41e8d0fe610b6c4877ac7e6e Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Mon, 21 Oct 2024 22:58:27 -0700 Subject: [PATCH 16/52] Might be nice to cache things --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb89dfd..9d50ff4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,10 @@ on: description: Newline separated list of files to build required: true type: string + cache: + description: Cache build directory + required: false + default: false esphome-version: description: Version of ESPHome to build with required: false @@ -141,6 +145,7 @@ jobs: id: esphome-build with: yaml-file: ${{ matrix.file }} + cache: ${{ inputs.cache }} version: ${{ inputs.esphome-version }} complete-manifest: true release-summary: ${{ inputs.release-summary }} From 5f2cc6ace4f9b35d3a30e6b89096ec6b2239b5e2 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Mon, 21 Oct 2024 23:00:50 -0700 Subject: [PATCH 17/52] What if this works now --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d50ff4..687a2e4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,6 +10,7 @@ on: cache: description: Cache build directory required: false + type: boolean default: false esphome-version: description: Version of ESPHome to build with From 5f6392ae2d0128225b5b4a6d282c763c4db44388 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Tue, 22 Oct 2024 00:37:53 -0700 Subject: [PATCH 18/52] Another pass with another substitution --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 687a2e4..7197cf1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,6 +58,10 @@ on: description: Combine all files into a single manifest under this name required: true type: string + volcano_mac_address: + description: Combine all files into a single manifest under this name + required: true + type: string # secrets: # wifi_ssid: # description: Combine all files into a single manifest under this name @@ -130,6 +134,7 @@ jobs: encryption_key: ${{ inputs.encryption_key }} ota_password: ${{ inputs.ota_password }} rufus_url: ${{ inputs.rufus_url }} + volcano_mac_address: $${{ inputs.volcano_mac_address }} # wifi_ssid: ${{ secrets.wifi_ssid }} # wifi_password: ${{ secrets.wifi_password }} # encryption_key: ${{ secrets.encryption_key }} From f5b1a2dc4b17c6284203e81c0ac1d1e5680b171d Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Tue, 22 Oct 2024 00:44:05 -0700 Subject: [PATCH 19/52] Yet another pass here --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7197cf1..46ea825 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -125,7 +125,7 @@ jobs: uses: actions/checkout@v4.2.1 - name: Configure secrets.yaml file run: | - python -c "import os; import yaml; print(os.environ); secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key'], ota_password=os.environ['ota_password'], rufus_url=os.environ['rufus_url']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" + python -c "import os; import yaml; print(os.environ); secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key'], ota_password=os.environ['ota_password'], rufus_url=os.environ['rufus_url'], volcano_mac_address=os.environ['volcano_mac_address']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" shell: bash env: # FIXME: this should be a secret From ba00f362f514213da48f9f2a8d197f8e91a2c6cf Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Tue, 22 Oct 2024 00:53:45 -0700 Subject: [PATCH 20/52] Oops, definitely a typo there --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 46ea825..8f47b20 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -134,7 +134,7 @@ jobs: encryption_key: ${{ inputs.encryption_key }} ota_password: ${{ inputs.ota_password }} rufus_url: ${{ inputs.rufus_url }} - volcano_mac_address: $${{ inputs.volcano_mac_address }} + volcano_mac_address: ${{ inputs.volcano_mac_address }} # wifi_ssid: ${{ secrets.wifi_ssid }} # wifi_password: ${{ secrets.wifi_password }} # encryption_key: ${{ secrets.encryption_key }} From 81ef1885edcf04f632391df59ca8d33f392e2420 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Tue, 22 Oct 2024 01:08:24 -0700 Subject: [PATCH 21/52] Another pass for the gaggia timer media file path --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8f47b20..41b34b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,6 +62,10 @@ on: description: Combine all files into a single manifest under this name required: true type: string + gaggia_timer_alarm_media_file_path: + description: Combine all files into a single manifest under this name + required: true + type: string # secrets: # wifi_ssid: # description: Combine all files into a single manifest under this name @@ -135,6 +139,7 @@ jobs: ota_password: ${{ inputs.ota_password }} rufus_url: ${{ inputs.rufus_url }} volcano_mac_address: ${{ inputs.volcano_mac_address }} + gaggia_timer_alarm_media_file_path: ${{ inputs.gaggia_timer_alarm_media_file_path }} # wifi_ssid: ${{ secrets.wifi_ssid }} # wifi_password: ${{ secrets.wifi_password }} # encryption_key: ${{ secrets.encryption_key }} From 09b22d19e7ab34d32c7525f6ebc15af89afe0e2a Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Tue, 22 Oct 2024 01:10:14 -0700 Subject: [PATCH 22/52] And I needed that part too --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 41b34b8..b4d2c0b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -129,7 +129,7 @@ jobs: uses: actions/checkout@v4.2.1 - name: Configure secrets.yaml file run: | - python -c "import os; import yaml; print(os.environ); secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key'], ota_password=os.environ['ota_password'], rufus_url=os.environ['rufus_url'], volcano_mac_address=os.environ['volcano_mac_address']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" + python -c "import os; import yaml; print(os.environ); secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key'], ota_password=os.environ['ota_password'], rufus_url=os.environ['rufus_url'], volcano_mac_address=os.environ['volcano_mac_address'], gaggia_timer_alarm_media_file_path=os.environ['gaggia_timer_alarm_media_file_path']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" shell: bash env: # FIXME: this should be a secret From d57a36849b8288d848f8ff5eb06a03852e6d978f Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Tue, 22 Oct 2024 10:01:35 -0700 Subject: [PATCH 23/52] Fix for front door lock --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b4d2c0b..47ab21f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,6 +66,10 @@ on: description: Combine all files into a single manifest under this name required: true type: string + front_door_lock_url: + description: Combine all files into a single manifest under this name + required: true + type: string # secrets: # wifi_ssid: # description: Combine all files into a single manifest under this name @@ -129,7 +133,7 @@ jobs: uses: actions/checkout@v4.2.1 - name: Configure secrets.yaml file run: | - python -c "import os; import yaml; print(os.environ); secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key'], ota_password=os.environ['ota_password'], rufus_url=os.environ['rufus_url'], volcano_mac_address=os.environ['volcano_mac_address'], gaggia_timer_alarm_media_file_path=os.environ['gaggia_timer_alarm_media_file_path']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" + python -c "import os; import yaml; print(os.environ); secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key'], ota_password=os.environ['ota_password'], rufus_url=os.environ['rufus_url'], volcano_mac_address=os.environ['volcano_mac_address'], gaggia_timer_alarm_media_file_path=os.environ['gaggia_timer_alarm_media_file_path'], front_door_lock_url=os.environ['front_door_lock_url']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" shell: bash env: # FIXME: this should be a secret @@ -140,6 +144,7 @@ jobs: rufus_url: ${{ inputs.rufus_url }} volcano_mac_address: ${{ inputs.volcano_mac_address }} gaggia_timer_alarm_media_file_path: ${{ inputs.gaggia_timer_alarm_media_file_path }} + front_door_lock_url: ${{ inputs.front_door_lock_url }} # wifi_ssid: ${{ secrets.wifi_ssid }} # wifi_password: ${{ secrets.wifi_password }} # encryption_key: ${{ secrets.encryption_key }} From cda913c2291040e059cf309c954ae7033cccf17a Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Tue, 22 Oct 2024 10:03:42 -0700 Subject: [PATCH 24/52] Hoping this covers everything --- .github/workflows/build.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 47ab21f..3c2c67f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,6 +70,18 @@ on: description: Combine all files into a single manifest under this name required: true type: string + back_door_lock_url: + description: Combine all files into a single manifest under this name + required: true + type: string + milanais_username: + description: Combine all files into a single manifest under this name + required: true + type: string + milanais_password: + description: Combine all files into a single manifest under this name + required: true + type: string # secrets: # wifi_ssid: # description: Combine all files into a single manifest under this name @@ -133,7 +145,7 @@ jobs: uses: actions/checkout@v4.2.1 - name: Configure secrets.yaml file run: | - python -c "import os; import yaml; print(os.environ); secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key'], ota_password=os.environ['ota_password'], rufus_url=os.environ['rufus_url'], volcano_mac_address=os.environ['volcano_mac_address'], gaggia_timer_alarm_media_file_path=os.environ['gaggia_timer_alarm_media_file_path'], front_door_lock_url=os.environ['front_door_lock_url']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" + python -c "import os; import yaml; print(os.environ); secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key'], ota_password=os.environ['ota_password'], rufus_url=os.environ['rufus_url'], volcano_mac_address=os.environ['volcano_mac_address'], gaggia_timer_alarm_media_file_path=os.environ['gaggia_timer_alarm_media_file_path'], front_door_lock_url=os.environ['front_door_lock_url'], back_door_lock_url=os.environ['back_door_lock_url'], milanais_username=os.environ['milanais_username'], milanais_password=os.environ['milanais_password']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" shell: bash env: # FIXME: this should be a secret @@ -145,6 +157,9 @@ jobs: volcano_mac_address: ${{ inputs.volcano_mac_address }} gaggia_timer_alarm_media_file_path: ${{ inputs.gaggia_timer_alarm_media_file_path }} front_door_lock_url: ${{ inputs.front_door_lock_url }} + back_door_lock_url: ${{ inputs.back_door_lock_url }} + milanais_username: ${{ inputs.milanais_username }} + milanais_password: ${{ inputs.milanais_password }} # wifi_ssid: ${{ secrets.wifi_ssid }} # wifi_password: ${{ secrets.wifi_password }} # encryption_key: ${{ secrets.encryption_key }} From 15ae7bdeb2cd57d8c9f243fefc9ae0fef756c07e Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Tue, 22 Oct 2024 14:41:19 -0700 Subject: [PATCH 25/52] Curious about this now --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3c2c67f..936e909 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -160,6 +160,7 @@ jobs: back_door_lock_url: ${{ inputs.back_door_lock_url }} milanais_username: ${{ inputs.milanais_username }} milanais_password: ${{ inputs.milanais_password }} + test_ota_password: ${{ secrets.OTA_PASSWORD }} # wifi_ssid: ${{ secrets.wifi_ssid }} # wifi_password: ${{ secrets.wifi_password }} # encryption_key: ${{ secrets.encryption_key }} From 886bfc3b1439e01ff2a1b210d3535fdb9d03c6c8 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Tue, 22 Oct 2024 14:56:05 -0700 Subject: [PATCH 26/52] And again here with proper secrets (I hope) --- .github/workflows/build.yml | 112 +++++++++++++++++++----------------- 1 file changed, 59 insertions(+), 53 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 936e909..6d55bd3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,50 +38,54 @@ on: type: string default: "" # FIXME: this should be a secret - wifi_ssid: - description: Combine all files into a single manifest under this name - required: true - type: string - wifi_password: - description: Combine all files into a single manifest under this name - required: true - type: string - encryption_key: - description: Combine all files into a single manifest under this name - required: true - type: string - ota_password: - description: Combine all files into a single manifest under this name - required: true - type: string - rufus_url: - description: Combine all files into a single manifest under this name - required: true - type: string - volcano_mac_address: - description: Combine all files into a single manifest under this name - required: true - type: string - gaggia_timer_alarm_media_file_path: - description: Combine all files into a single manifest under this name - required: true - type: string - front_door_lock_url: - description: Combine all files into a single manifest under this name - required: true - type: string - back_door_lock_url: - description: Combine all files into a single manifest under this name - required: true - type: string - milanais_username: - description: Combine all files into a single manifest under this name - required: true - type: string - milanais_password: + secret-environment: description: Combine all files into a single manifest under this name required: true type: string +# wifi_ssid: +# description: Combine all files into a single manifest under this name +# required: true +# type: string +# wifi_password: +# description: Combine all files into a single manifest under this name +# required: true +# type: string +# encryption_key: +# description: Combine all files into a single manifest under this name +# required: true +# type: string +# ota_password: +# description: Combine all files into a single manifest under this name +# required: true +# type: string +# rufus_url: +# description: Combine all files into a single manifest under this name +# required: true +# type: string +# volcano_mac_address: +# description: Combine all files into a single manifest under this name +# required: true +# type: string +# gaggia_timer_alarm_media_file_path: +# description: Combine all files into a single manifest under this name +# required: true +# type: string +# front_door_lock_url: +# description: Combine all files into a single manifest under this name +# required: true +# type: string +# back_door_lock_url: +# description: Combine all files into a single manifest under this name +# required: true +# type: string +# milanais_username: +# description: Combine all files into a single manifest under this name +# required: true +# type: string +# milanais_password: +# description: Combine all files into a single manifest under this name +# required: true +# type: string # secrets: # wifi_ssid: # description: Combine all files into a single manifest under this name @@ -135,6 +139,8 @@ jobs: name: ${{ matrix.file }} needs: [prepare] runs-on: ubuntu-latest + environment: + name: ${{ inputs.secret-environment }} strategy: fail-fast: false max-parallel: 3 @@ -149,18 +155,18 @@ jobs: shell: bash env: # FIXME: this should be a secret - wifi_ssid: ${{ inputs.wifi_ssid }} - wifi_password: ${{ inputs.wifi_password }} - encryption_key: ${{ inputs.encryption_key }} - ota_password: ${{ inputs.ota_password }} - rufus_url: ${{ inputs.rufus_url }} - volcano_mac_address: ${{ inputs.volcano_mac_address }} - gaggia_timer_alarm_media_file_path: ${{ inputs.gaggia_timer_alarm_media_file_path }} - front_door_lock_url: ${{ inputs.front_door_lock_url }} - back_door_lock_url: ${{ inputs.back_door_lock_url }} - milanais_username: ${{ inputs.milanais_username }} - milanais_password: ${{ inputs.milanais_password }} - test_ota_password: ${{ secrets.OTA_PASSWORD }} + wifi_ssid: ${{ secrets.WIFI_SSID }} + wifi_password: ${{ secrets.WIFI_PASSWORD }} + encryption_key: ${{ secrets.ENCRYPTION_KEY }} + ota_password: ${{ secrets.OTA_PASSWORD }} + rufus_url: ${{ secrets.RUFUS_URL }} + volcano_mac_address: ${{ secrets.VOLCANO_MAC_ADDRESS }} + gaggia_timer_alarm_media_file_path: ${{ secrets.GAGGIA_TIMER_ALARM_MEDIA_FILE_PATH }} + front_door_lock_url: ${{ secrets.FRONT_DOOR_LOCK_URL }} + back_door_lock_url: ${{ secrets.BACK_DOOR_LOCK_URL }} + milanais_username: ${{ secrets.MILANAIS_USERNAME }} + milanais_password: ${{ secrets.MILANAIS_PASSWORD }} +# test_ota_password: ${{ secrets.OTA_PASSWORD }} # wifi_ssid: ${{ secrets.wifi_ssid }} # wifi_password: ${{ secrets.wifi_password }} # encryption_key: ${{ secrets.encryption_key }} From dcc5f494a1ae26971bce701f3a37793337b81458 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Tue, 22 Oct 2024 14:56:48 -0700 Subject: [PATCH 27/52] Adjust variable name --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6d55bd3..a9c8e42 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,7 +38,7 @@ on: type: string default: "" # FIXME: this should be a secret - secret-environment: + secrets-environment: description: Combine all files into a single manifest under this name required: true type: string @@ -140,7 +140,7 @@ jobs: needs: [prepare] runs-on: ubuntu-latest environment: - name: ${{ inputs.secret-environment }} + name: ${{ inputs.secrets-environment }} strategy: fail-fast: false max-parallel: 3 From c731fd5248fd9590bba71e27d7c9b3ab37f0f813 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Tue, 22 Oct 2024 15:00:00 -0700 Subject: [PATCH 28/52] And again with more small changes --- .github/workflows/build.yml | 67 ++----------------------------------- 1 file changed, 3 insertions(+), 64 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a9c8e42..e50a35b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,68 +37,11 @@ on: required: false type: string default: "" - # FIXME: this should be a secret + # FIXME: this should be optional secrets-environment: description: Combine all files into a single manifest under this name required: true type: string -# wifi_ssid: -# description: Combine all files into a single manifest under this name -# required: true -# type: string -# wifi_password: -# description: Combine all files into a single manifest under this name -# required: true -# type: string -# encryption_key: -# description: Combine all files into a single manifest under this name -# required: true -# type: string -# ota_password: -# description: Combine all files into a single manifest under this name -# required: true -# type: string -# rufus_url: -# description: Combine all files into a single manifest under this name -# required: true -# type: string -# volcano_mac_address: -# description: Combine all files into a single manifest under this name -# required: true -# type: string -# gaggia_timer_alarm_media_file_path: -# description: Combine all files into a single manifest under this name -# required: true -# type: string -# front_door_lock_url: -# description: Combine all files into a single manifest under this name -# required: true -# type: string -# back_door_lock_url: -# description: Combine all files into a single manifest under this name -# required: true -# type: string -# milanais_username: -# description: Combine all files into a single manifest under this name -# required: true -# type: string -# milanais_password: -# description: Combine all files into a single manifest under this name -# required: true -# type: string -# secrets: -# wifi_ssid: -# description: Combine all files into a single manifest under this name -# required: true -# wifi_password: -# description: Combine all files into a single manifest under this name -# required: true -# encryption_key: -# description: Combine all files into a single manifest under this name -# required: true -# ota_password: -# description: Combine all files into a single manifest under this name -# required: true outputs: version: @@ -154,7 +97,7 @@ jobs: python -c "import os; import yaml; print(os.environ); secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key'], ota_password=os.environ['ota_password'], rufus_url=os.environ['rufus_url'], volcano_mac_address=os.environ['volcano_mac_address'], gaggia_timer_alarm_media_file_path=os.environ['gaggia_timer_alarm_media_file_path'], front_door_lock_url=os.environ['front_door_lock_url'], back_door_lock_url=os.environ['back_door_lock_url'], milanais_username=os.environ['milanais_username'], milanais_password=os.environ['milanais_password']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" shell: bash env: - # FIXME: this should be a secret + # FIXME: this should be more dynamic wifi_ssid: ${{ secrets.WIFI_SSID }} wifi_password: ${{ secrets.WIFI_PASSWORD }} encryption_key: ${{ secrets.ENCRYPTION_KEY }} @@ -166,11 +109,7 @@ jobs: back_door_lock_url: ${{ secrets.BACK_DOOR_LOCK_URL }} milanais_username: ${{ secrets.MILANAIS_USERNAME }} milanais_password: ${{ secrets.MILANAIS_PASSWORD }} -# test_ota_password: ${{ secrets.OTA_PASSWORD }} -# wifi_ssid: ${{ secrets.wifi_ssid }} -# wifi_password: ${{ secrets.wifi_password }} -# encryption_key: ${{ secrets.encryption_key }} -# ota_password: ${{ secrets.ota_password }} + - name: DEBUG echo the secrets.yaml file run: | cat albionboxes/secrets.yaml From a910eede68c3e6794d5d24a9df336bab2c5158d4 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Tue, 22 Oct 2024 20:46:02 -0700 Subject: [PATCH 29/52] Trying again, but now with a more dynamic file --- .github/workflows/build.yml | 57 ++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e50a35b..f2018f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,11 +37,20 @@ on: required: false type: string default: "" - # FIXME: this should be optional secrets-environment: - description: Combine all files into a single manifest under this name - required: true + description: Environment to use to access secrets + required: false + type: string + default: "" + secrets-yaml-file: + description: The secrets.yaml file as a base64 encoded string (from a secret) + required: false type: string + secrets-yaml-file-path: + description: Location of secrets.yaml file + required: false + type: string + default: "secrets.yaml" outputs: version: @@ -93,22 +102,32 @@ jobs: - name: Checkout code uses: actions/checkout@v4.2.1 - name: Configure secrets.yaml file - run: | - python -c "import os; import yaml; print(os.environ); secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key'], ota_password=os.environ['ota_password'], rufus_url=os.environ['rufus_url'], volcano_mac_address=os.environ['volcano_mac_address'], gaggia_timer_alarm_media_file_path=os.environ['gaggia_timer_alarm_media_file_path'], front_door_lock_url=os.environ['front_door_lock_url'], back_door_lock_url=os.environ['back_door_lock_url'], milanais_username=os.environ['milanais_username'], milanais_password=os.environ['milanais_password']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" - shell: bash - env: - # FIXME: this should be more dynamic - wifi_ssid: ${{ secrets.WIFI_SSID }} - wifi_password: ${{ secrets.WIFI_PASSWORD }} - encryption_key: ${{ secrets.ENCRYPTION_KEY }} - ota_password: ${{ secrets.OTA_PASSWORD }} - rufus_url: ${{ secrets.RUFUS_URL }} - volcano_mac_address: ${{ secrets.VOLCANO_MAC_ADDRESS }} - gaggia_timer_alarm_media_file_path: ${{ secrets.GAGGIA_TIMER_ALARM_MEDIA_FILE_PATH }} - front_door_lock_url: ${{ secrets.FRONT_DOOR_LOCK_URL }} - back_door_lock_url: ${{ secrets.BACK_DOOR_LOCK_URL }} - milanais_username: ${{ secrets.MILANAIS_USERNAME }} - milanais_password: ${{ secrets.MILANAIS_PASSWORD }} + if: inputs.secrets-yaml-file != '' + uses: akiojin/decode-base64-github-action@v1 + id: decode-base64 + with: + base64: ${{ inputs.secrets-yaml-file }} + output-path: ${{ inputs.secrets-yaml-file-path }} + - run: | + echo "Path=${{ steps.decode-base64.outputs.output-path }}" + cat ${{ steps.decode-base64.outputs.output-path }} +# - name: Configure secrets.yaml file +# run: | +# python -c "import os; import yaml; print(os.environ); secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key'], ota_password=os.environ['ota_password'], rufus_url=os.environ['rufus_url'], volcano_mac_address=os.environ['volcano_mac_address'], gaggia_timer_alarm_media_file_path=os.environ['gaggia_timer_alarm_media_file_path'], front_door_lock_url=os.environ['front_door_lock_url'], back_door_lock_url=os.environ['back_door_lock_url'], milanais_username=os.environ['milanais_username'], milanais_password=os.environ['milanais_password']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" +# shell: bash +# env: +# # FIXME: this should be more dynamic +# wifi_ssid: ${{ secrets.WIFI_SSID }} +# wifi_password: ${{ secrets.WIFI_PASSWORD }} +# encryption_key: ${{ secrets.ENCRYPTION_KEY }} +# ota_password: ${{ secrets.OTA_PASSWORD }} +# rufus_url: ${{ secrets.RUFUS_URL }} +# volcano_mac_address: ${{ secrets.VOLCANO_MAC_ADDRESS }} +# gaggia_timer_alarm_media_file_path: ${{ secrets.GAGGIA_TIMER_ALARM_MEDIA_FILE_PATH }} +# front_door_lock_url: ${{ secrets.FRONT_DOOR_LOCK_URL }} +# back_door_lock_url: ${{ secrets.BACK_DOOR_LOCK_URL }} +# milanais_username: ${{ secrets.MILANAIS_USERNAME }} +# milanais_password: ${{ secrets.MILANAIS_PASSWORD }} - name: DEBUG echo the secrets.yaml file run: | From 9b159348985ade91a3900eb272b3ed53c930b2d7 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Tue, 22 Oct 2024 20:53:13 -0700 Subject: [PATCH 30/52] Trying again here --- .github/workflows/build.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f2018f3..55dc633 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,10 +42,10 @@ on: required: false type: string default: "" - secrets-yaml-file: - description: The secrets.yaml file as a base64 encoded string (from a secret) - required: false - type: string + # secrets-yaml-file: + # description: The secrets.yaml file as a base64 encoded string (from a secret) + # required: false + # type: string secrets-yaml-file-path: description: Location of secrets.yaml file required: false @@ -102,11 +102,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4.2.1 - name: Configure secrets.yaml file - if: inputs.secrets-yaml-file != '' + # if: inputs.secrets-yaml-file != '' + if: secrets.ESPHOME_SECRETS_YAML != '' uses: akiojin/decode-base64-github-action@v1 id: decode-base64 with: - base64: ${{ inputs.secrets-yaml-file }} + base64: ${{ secrets.ESPHOME_SECRETS_YAML }} output-path: ${{ inputs.secrets-yaml-file-path }} - run: | echo "Path=${{ steps.decode-base64.outputs.output-path }}" From b554dc189192f326cec39dfe0db4e94cfbf78f00 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Tue, 22 Oct 2024 20:55:32 -0700 Subject: [PATCH 31/52] And again with the workflow --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 55dc633..6855189 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,7 +103,7 @@ jobs: uses: actions/checkout@v4.2.1 - name: Configure secrets.yaml file # if: inputs.secrets-yaml-file != '' - if: secrets.ESPHOME_SECRETS_YAML != '' + # if: secrets.ESPHOME_SECRETS_YAML != '' uses: akiojin/decode-base64-github-action@v1 id: decode-base64 with: From 0c5aaebc2c6e9e93a70fb370ff0bd671ac5dd8fd Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Tue, 22 Oct 2024 20:57:24 -0700 Subject: [PATCH 32/52] Will this help --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6855189..f0a8e3f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -104,7 +104,7 @@ jobs: - name: Configure secrets.yaml file # if: inputs.secrets-yaml-file != '' # if: secrets.ESPHOME_SECRETS_YAML != '' - uses: akiojin/decode-base64-github-action@v1 + uses: akiojin/decode-base64-github-action@v1.0.2 id: decode-base64 with: base64: ${{ secrets.ESPHOME_SECRETS_YAML }} From bb9fd9363ba65b11dc5e54283adbedf9cd9e9f3e Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Tue, 22 Oct 2024 21:00:50 -0700 Subject: [PATCH 33/52] Well that's pretty cool now --- .github/workflows/build.yml | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f0a8e3f..782714c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -109,30 +109,9 @@ jobs: with: base64: ${{ secrets.ESPHOME_SECRETS_YAML }} output-path: ${{ inputs.secrets-yaml-file-path }} - - run: | - echo "Path=${{ steps.decode-base64.outputs.output-path }}" - cat ${{ steps.decode-base64.outputs.output-path }} -# - name: Configure secrets.yaml file -# run: | -# python -c "import os; import yaml; print(os.environ); secrets_data = dict(wifi_ssid=os.environ['wifi_ssid'], wifi_password=os.environ['wifi_password'], encryption_key=os.environ['encryption_key'], ota_password=os.environ['ota_password'], rufus_url=os.environ['rufus_url'], volcano_mac_address=os.environ['volcano_mac_address'], gaggia_timer_alarm_media_file_path=os.environ['gaggia_timer_alarm_media_file_path'], front_door_lock_url=os.environ['front_door_lock_url'], back_door_lock_url=os.environ['back_door_lock_url'], milanais_username=os.environ['milanais_username'], milanais_password=os.environ['milanais_password']); secrets_file = open('albionboxes/secrets.yaml', 'w'); yaml.dump(secrets_data, secrets_file, default_flow_style=False); secrets_file.close()" -# shell: bash -# env: -# # FIXME: this should be more dynamic -# wifi_ssid: ${{ secrets.WIFI_SSID }} -# wifi_password: ${{ secrets.WIFI_PASSWORD }} -# encryption_key: ${{ secrets.ENCRYPTION_KEY }} -# ota_password: ${{ secrets.OTA_PASSWORD }} -# rufus_url: ${{ secrets.RUFUS_URL }} -# volcano_mac_address: ${{ secrets.VOLCANO_MAC_ADDRESS }} -# gaggia_timer_alarm_media_file_path: ${{ secrets.GAGGIA_TIMER_ALARM_MEDIA_FILE_PATH }} -# front_door_lock_url: ${{ secrets.FRONT_DOOR_LOCK_URL }} -# back_door_lock_url: ${{ secrets.BACK_DOOR_LOCK_URL }} -# milanais_username: ${{ secrets.MILANAIS_USERNAME }} -# milanais_password: ${{ secrets.MILANAIS_PASSWORD }} - - - name: DEBUG echo the secrets.yaml file + - name: Echo the secrets.yaml file path run: | - cat albionboxes/secrets.yaml + echo "Path=${{ steps.decode-base64.outputs.output-path }}" shell: bash - name: Replace project version run: | From 1cc43f3e377ed9fda537a73f178b828412ed7721 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Thu, 14 Nov 2024 09:51:22 -0800 Subject: [PATCH 34/52] Wanted one more try --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 782714c..2294c80 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -112,6 +112,7 @@ jobs: - name: Echo the secrets.yaml file path run: | echo "Path=${{ steps.decode-base64.outputs.output-path }}" + cat ${{ steps.decode-base64.outputs.output-path }} shell: bash - name: Replace project version run: | From 86846320887ba42504d231b5a4a45cc0aaa398cc Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Thu, 14 Nov 2024 09:54:30 -0800 Subject: [PATCH 35/52] Now don't print out secrets --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2294c80..782714c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -112,7 +112,6 @@ jobs: - name: Echo the secrets.yaml file path run: | echo "Path=${{ steps.decode-base64.outputs.output-path }}" - cat ${{ steps.decode-base64.outputs.output-path }} shell: bash - name: Replace project version run: | From 69b8393a2f8de2097b21da27177972c665212d46 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Mon, 10 Feb 2025 13:39:41 -0800 Subject: [PATCH 36/52] Remove caching --- .github/workflows/build.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 718935f..b7465d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,11 +7,6 @@ on: description: Newline separated list of files to build required: true type: string - cache: - description: Cache build directory - required: false - type: boolean - default: false esphome-version: description: Version of ESPHome to build with required: false @@ -121,7 +116,6 @@ jobs: id: esphome-build with: yaml-file: ${{ matrix.file }} - cache: ${{ inputs.cache }} version: ${{ inputs.esphome-version }} complete-manifest: true release-summary: ${{ inputs.release-summary }} From 7b17033db804aa6b8c2a885f8d7f1ea657beee86 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Sun, 30 Mar 2025 20:33:24 -0700 Subject: [PATCH 37/52] Trying again now --- .github/workflows/build.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b7465d7..3d8abd6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,15 +37,6 @@ on: required: false type: string default: "" - # secrets-yaml-file: - # description: The secrets.yaml file as a base64 encoded string (from a secret) - # required: false - # type: string - secrets-yaml-file-path: - description: Location of secrets.yaml file - required: false - type: string - default: "secrets.yaml" outputs: version: @@ -99,11 +90,8 @@ jobs: - name: Configure secrets.yaml file # if: inputs.secrets-yaml-file != '' # if: secrets.ESPHOME_SECRETS_YAML != '' - uses: akiojin/decode-base64-github-action@v1.0.2 id: decode-base64 - with: - base64: ${{ secrets.ESPHOME_SECRETS_YAML }} - output-path: ${{ inputs.secrets-yaml-file-path }} + run: echo "${{ secrets.ESPHOME_SECRETS_YAML }}" | base64 -d > ${{ $(dirname ${{ matrix.file }})/secrets.yaml }} - name: Echo the secrets.yaml file path run: | echo "Path=${{ steps.decode-base64.outputs.output-path }}" From 839cef575b96cde10643007bfa17f502ae44aaac Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Sun, 30 Mar 2025 20:39:02 -0700 Subject: [PATCH 38/52] There we go --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8c042c4..79345ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,6 +37,11 @@ on: required: false type: string default: "" + secrets-yaml-file-path: + description: Location of secrets.yaml file + required: false + type: string + default: "$(dirname ${{ matrix.file }})/secrets.yaml" outputs: version: @@ -91,7 +96,7 @@ jobs: # if: inputs.secrets-yaml-file != '' # if: secrets.ESPHOME_SECRETS_YAML != '' id: decode-base64 - run: echo "${{ secrets.ESPHOME_SECRETS_YAML }}" | base64 -d > ${{ $(dirname ${{ matrix.file }})/secrets.yaml }} + run: echo "${{ secrets.ESPHOME_SECRETS_YAML }}" | base64 -d > ${{ inputs.secrets-yaml-file-path }} - name: Echo the secrets.yaml file path run: | echo "Path=${{ steps.decode-base64.outputs.output-path }}" From 720553d71a86fd204f24f779bb2bc69a88c43614 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Sun, 30 Mar 2025 20:41:00 -0700 Subject: [PATCH 39/52] And trying again --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 79345ca..d563a7a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,7 +41,7 @@ on: description: Location of secrets.yaml file required: false type: string - default: "$(dirname ${{ matrix.file }})/secrets.yaml" + default: $(dirname ${{ matrix.file }})/secrets.yaml outputs: version: From 8438501f98439206b325fe942c3223b895291cae Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Sun, 30 Mar 2025 20:43:34 -0700 Subject: [PATCH 40/52] What about this --- .github/workflows/build.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d563a7a..f07f9a4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,11 +37,6 @@ on: required: false type: string default: "" - secrets-yaml-file-path: - description: Location of secrets.yaml file - required: false - type: string - default: $(dirname ${{ matrix.file }})/secrets.yaml outputs: version: @@ -96,7 +91,7 @@ jobs: # if: inputs.secrets-yaml-file != '' # if: secrets.ESPHOME_SECRETS_YAML != '' id: decode-base64 - run: echo "${{ secrets.ESPHOME_SECRETS_YAML }}" | base64 -d > ${{ inputs.secrets-yaml-file-path }} + run: echo "${{ secrets.ESPHOME_SECRETS_YAML }}" | base64 -d > $(dirname ${{ matrix.file }})/secrets.yaml - name: Echo the secrets.yaml file path run: | echo "Path=${{ steps.decode-base64.outputs.output-path }}" From bbbf5c1f7b0a756f9796423dc5494853f807dc06 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Sun, 30 Mar 2025 20:55:42 -0700 Subject: [PATCH 41/52] Now really curious about this --- .github/workflows/build.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f07f9a4..b7462e7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,6 +37,11 @@ on: required: false type: string default: "" + cache: + description: Cache build directory + required: false + type: boolean + default: false outputs: version: @@ -87,6 +92,32 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4.2.2 + - if: ${{ inputs.cache == 'true' }} + id: data-dir + shell: bash + run: | + data_dir=$(dirname ${{ matrix.file }})/.esphome + echo "data_dir=$data_dir" >> $GITHUB_OUTPUT + - if: ${{ inputs.cache == 'true' }} + name: Cache platformio directory + uses: actions/cache@v4.2.3 + with: + path: ~/.platformio + key: ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-platformio + - if: ${{ inputs.cache == 'true' }} + name: Cache build directory + uses: actions/cache@v4.2.3 + with: + path: ${{ steps.data-dir.outputs.data_dir }}/build + key: ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-build + save-always: true + - if: ${{ inputs.cache == 'true' }} + name: Cache storage directory + uses: actions/cache@v4.2.3 + with: + path: ${{ steps.data-dir.outputs.data_dir }}/storage + key: ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-storage + save-always: true - name: Configure secrets.yaml file # if: inputs.secrets-yaml-file != '' # if: secrets.ESPHOME_SECRETS_YAML != '' From 6448d82e67a1ea5bbf581bbc3ea44e40c9cde59e Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Sun, 30 Mar 2025 20:59:16 -0700 Subject: [PATCH 42/52] One more try I guess --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b7462e7..7259e6d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -92,26 +92,26 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4.2.2 - - if: ${{ inputs.cache == 'true' }} + - if: ${{ inputs.cache == true || inputs.cache == 'true' }} id: data-dir shell: bash run: | data_dir=$(dirname ${{ matrix.file }})/.esphome echo "data_dir=$data_dir" >> $GITHUB_OUTPUT - - if: ${{ inputs.cache == 'true' }} + - if: ${{ inputs.cache == true || inputs.cache == 'true' }} name: Cache platformio directory uses: actions/cache@v4.2.3 with: path: ~/.platformio key: ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-platformio - - if: ${{ inputs.cache == 'true' }} + - if: ${{ inputs.cache == true || inputs.cache == 'true' }} name: Cache build directory uses: actions/cache@v4.2.3 with: path: ${{ steps.data-dir.outputs.data_dir }}/build key: ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-build save-always: true - - if: ${{ inputs.cache == 'true' }} + - if: ${{ inputs.cache == true || inputs.cache == 'true' }} name: Cache storage directory uses: actions/cache@v4.2.3 with: From fd1358f1cc56c4a6d89f270fe18f5ad4838a9a11 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Sun, 30 Mar 2025 21:13:17 -0700 Subject: [PATCH 43/52] And another try needed --- .github/workflows/build.yml | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7259e6d..ac40bbe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -99,25 +99,16 @@ jobs: data_dir=$(dirname ${{ matrix.file }})/.esphome echo "data_dir=$data_dir" >> $GITHUB_OUTPUT - if: ${{ inputs.cache == true || inputs.cache == 'true' }} - name: Cache platformio directory - uses: actions/cache@v4.2.3 + name: Restore build cache directory + id: cache-build-restore + uses: actions/cache/restore@v4.2.3 with: - path: ~/.platformio - key: ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-platformio - - if: ${{ inputs.cache == true || inputs.cache == 'true' }} - name: Cache build directory - uses: actions/cache@v4.2.3 - with: - path: ${{ steps.data-dir.outputs.data_dir }}/build + path: | + ~/.esphome + ~/.platformio + ${{ steps.data-dir.outputs.data_dir }}/build + ${{ steps.data-dir.outputs.data_dir }}/storage key: ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-build - save-always: true - - if: ${{ inputs.cache == true || inputs.cache == 'true' }} - name: Cache storage directory - uses: actions/cache@v4.2.3 - with: - path: ${{ steps.data-dir.outputs.data_dir }}/storage - key: ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-storage - save-always: true - name: Configure secrets.yaml file # if: inputs.secrets-yaml-file != '' # if: secrets.ESPHOME_SECRETS_YAML != '' @@ -139,6 +130,17 @@ jobs: complete-manifest: true release-summary: ${{ inputs.release-summary }} release-url: ${{ inputs.release-url }} + - if: ${{ inputs.cache == true || inputs.cache == 'true' }} + name: Restore cache directory + id: cache-build-save + uses: actions/cache/save@v4.2.3 + with: + path: | + ~/.esphome + ~/.platformio + ${{ steps.data-dir.outputs.data_dir }}/build + ${{ steps.data-dir.outputs.data_dir }}/storage + key: ${{ steps.cache-build-restore.outputs.cache-primary-key }} - name: Move files for versioning run: | mkdir -p output/${{ needs.prepare.outputs.version }} From 6d0345860f7636de73b413e3e30ba023f5bf4197 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Sun, 30 Mar 2025 21:15:58 -0700 Subject: [PATCH 44/52] Now that's interesting --- .github/workflows/build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac40bbe..7795a27 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -114,10 +114,6 @@ jobs: # if: secrets.ESPHOME_SECRETS_YAML != '' id: decode-base64 run: echo "${{ secrets.ESPHOME_SECRETS_YAML }}" | base64 -d > $(dirname ${{ matrix.file }})/secrets.yaml - - name: Echo the secrets.yaml file path - run: | - echo "Path=${{ steps.decode-base64.outputs.output-path }}" - shell: bash - name: Replace project version run: | sed -i "s/version: dev/version: ${{ needs.prepare.outputs.version }}/g" ${{ matrix.file }} From a4d0e004a95291ae5fbbf801948c391f40aedc50 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Sun, 30 Mar 2025 21:18:05 -0700 Subject: [PATCH 45/52] One more pass with clean up --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7795a27..5d241a2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -127,7 +127,7 @@ jobs: release-summary: ${{ inputs.release-summary }} release-url: ${{ inputs.release-url }} - if: ${{ inputs.cache == true || inputs.cache == 'true' }} - name: Restore cache directory + name: Save build cache directory id: cache-build-save uses: actions/cache/save@v4.2.3 with: From 0dc2db518993a946a9cc3cfd992bd8e134c684e9 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Sun, 30 Mar 2025 21:27:48 -0700 Subject: [PATCH 46/52] And one more pass on this secret stuff --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d241a2..a8253da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -110,8 +110,7 @@ jobs: ${{ steps.data-dir.outputs.data_dir }}/storage key: ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-build - name: Configure secrets.yaml file - # if: inputs.secrets-yaml-file != '' - # if: secrets.ESPHOME_SECRETS_YAML != '' + if: ${{ inputs.secrets-environment != '' }} id: decode-base64 run: echo "${{ secrets.ESPHOME_SECRETS_YAML }}" | base64 -d > $(dirname ${{ matrix.file }})/secrets.yaml - name: Replace project version From 7c1f720f9604541d8cccaa5def44ef8a59640932 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Thu, 3 Apr 2025 17:12:35 -0700 Subject: [PATCH 47/52] Really curious about this tbh --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a8253da..1386dbd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -108,7 +108,10 @@ jobs: ~/.platformio ${{ steps.data-dir.outputs.data_dir }}/build ${{ steps.data-dir.outputs.data_dir }}/storage - key: ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-build + key: ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.head_ref }} + restore-keys: | + ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.head_ref }} + ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}- - name: Configure secrets.yaml file if: ${{ inputs.secrets-environment != '' }} id: decode-base64 From 8e45373b5661b89bc891b934c88cd025368b362a Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Thu, 3 Apr 2025 19:03:17 -0700 Subject: [PATCH 48/52] That's much better I think --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1386dbd..cd3bc2d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -108,9 +108,9 @@ jobs: ~/.platformio ${{ steps.data-dir.outputs.data_dir }}/build ${{ steps.data-dir.outputs.data_dir }}/storage - key: ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.head_ref }} + key: ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.ref }} restore-keys: | - ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.head_ref }} + ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.ref }} ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}- - name: Configure secrets.yaml file if: ${{ inputs.secrets-environment != '' }} From 6d1820cb1176448ae6f33ae20da63f696a3ee977 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Fri, 4 Apr 2025 17:14:14 -0700 Subject: [PATCH 49/52] Hm, I wonder about this --- .github/workflows/build.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cd3bc2d..043a444 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -104,13 +104,12 @@ jobs: uses: actions/cache/restore@v4.2.3 with: path: | - ~/.esphome ~/.platformio - ${{ steps.data-dir.outputs.data_dir }}/build - ${{ steps.data-dir.outputs.data_dir }}/storage - key: ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.ref }} + ${{ steps.data-dir.outputs.data_dir }} + key: ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.ref }}-${{ hashFiles('**/.esphome/build/**/dependencies.lock') }} restore-keys: | - ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.ref }} + ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.ref }}-${{ hashFiles('**/.esphome/build/**/dependencies.lock') }} + ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.ref }}- ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}- - name: Configure secrets.yaml file if: ${{ inputs.secrets-environment != '' }} @@ -134,10 +133,8 @@ jobs: uses: actions/cache/save@v4.2.3 with: path: | - ~/.esphome ~/.platformio - ${{ steps.data-dir.outputs.data_dir }}/build - ${{ steps.data-dir.outputs.data_dir }}/storage + ${{ steps.data-dir.outputs.data_dir }} key: ${{ steps.cache-build-restore.outputs.cache-primary-key }} - name: Move files for versioning run: | From 6c7e8c96108e4efabf90ace6a9a83a6c9ca0eb99 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Fri, 4 Apr 2025 17:22:15 -0700 Subject: [PATCH 50/52] Just curious --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 043a444..37eaf33 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -108,7 +108,7 @@ jobs: ${{ steps.data-dir.outputs.data_dir }} key: ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.ref }}-${{ hashFiles('**/.esphome/build/**/dependencies.lock') }} restore-keys: | - ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.ref }}-${{ hashFiles('**/.esphome/build/**/dependencies.lock') }} + ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.ref }}-${{ hashFiles('*.yaml', '*.yml', '**/*.yaml', '**/*.yml) }} ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.ref }}- ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}- - name: Configure secrets.yaml file From 9427354daefe5ebf0f93a4c79c13694d68cf8d9d Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Fri, 4 Apr 2025 17:23:40 -0700 Subject: [PATCH 51/52] Gah, got it --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 37eaf33..8bd39c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -106,9 +106,9 @@ jobs: path: | ~/.platformio ${{ steps.data-dir.outputs.data_dir }} - key: ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.ref }}-${{ hashFiles('**/.esphome/build/**/dependencies.lock') }} + key: ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.ref }}-${{ hashFiles('*.yaml', '*.yml', '**/*.yaml', '**/*.yml') }} restore-keys: | - ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.ref }}-${{ hashFiles('*.yaml', '*.yml', '**/*.yaml', '**/*.yml) }} + ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.ref }}-${{ hashFiles('*.yaml', '*.yml', '**/*.yaml', '**/*.yml') }} ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.ref }}- ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}- - name: Configure secrets.yaml file From afc0081b72ec0bcbf3fb739911444e79f9bcb35d Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Mon, 21 Apr 2025 10:26:24 -0700 Subject: [PATCH 52/52] And again --- .github/workflows/build.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8bd39c9..cd3bc2d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -104,12 +104,13 @@ jobs: uses: actions/cache/restore@v4.2.3 with: path: | + ~/.esphome ~/.platformio - ${{ steps.data-dir.outputs.data_dir }} - key: ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.ref }}-${{ hashFiles('*.yaml', '*.yml', '**/*.yaml', '**/*.yml') }} + ${{ steps.data-dir.outputs.data_dir }}/build + ${{ steps.data-dir.outputs.data_dir }}/storage + key: ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.ref }} restore-keys: | - ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.ref }}-${{ hashFiles('*.yaml', '*.yml', '**/*.yaml', '**/*.yml') }} - ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.ref }}- + ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}-${{ github.ref }} ${{ runner.os }}-esphome-${{ matrix.file }}-${{ inputs.esphome-version }}- - name: Configure secrets.yaml file if: ${{ inputs.secrets-environment != '' }} @@ -133,8 +134,10 @@ jobs: uses: actions/cache/save@v4.2.3 with: path: | + ~/.esphome ~/.platformio - ${{ steps.data-dir.outputs.data_dir }} + ${{ steps.data-dir.outputs.data_dir }}/build + ${{ steps.data-dir.outputs.data_dir }}/storage key: ${{ steps.cache-build-restore.outputs.cache-primary-key }} - name: Move files for versioning run: |