From 33b88c93a3e26a694c25ed82fb25a9f975d7545f Mon Sep 17 00:00:00 2001 From: sukuwc Date: Thu, 13 Nov 2025 18:49:27 +0100 Subject: [PATCH 1/2] SUKU parameterize workflows with product_name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made release workflows reusable across different products: - Added product_name input to production and nightly workflows - Updated zip filenames to use product_name (e.g., knot_release.zip) - Updated release titles to use product_name (e.g., "knot v1.0.7") - Production workflow now only zips files matching *_release_DATE.uf2 pattern - Set product_name to "knot" (lowercase) for this repository Benefits: - firmware_release_production.yml can be copied as-is to other repos - firmware_release_nightly.yml can be copied as-is to other repos - firmware_deploy_preview.yml already works as-is - Only need to customize firmware_build_only.yml and product_name per repo 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/firmware_release_nightly.yml | 14 ++++++++++++-- .../workflows/firmware_release_production.yml | 16 ++++++++++++---- .github/workflows/firmware_workflow.yml | 3 +++ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/firmware_release_nightly.yml b/.github/workflows/firmware_release_nightly.yml index f6630a9..b7ee948 100644 --- a/.github/workflows/firmware_release_nightly.yml +++ b/.github/workflows/firmware_release_nightly.yml @@ -2,7 +2,17 @@ name: "Firmware Nightly Release" on: workflow_call: + inputs: + product_name: + description: "Product name for release naming" + required: true + type: string workflow_dispatch: + inputs: + product_name: + description: "Product name for release naming" + required: true + type: string jobs: publish-nightly-release: @@ -80,7 +90,7 @@ jobs: uses: vimtor/action-zip@v1 with: files: build/ - dest: knot_nightly.zip + dest: ${{ inputs.product_name }}_nightly.zip - name: Build Changelog id: github_release @@ -95,7 +105,7 @@ jobs: with: name: Nightly Build tag_name: ${{ steps.get_version.outputs.tag_name }} - files: knot_nightly.zip + files: ${{ inputs.product_name }}_nightly.zip draft: false prerelease: true body: ${{steps.github_release.outputs.changelog}} diff --git a/.github/workflows/firmware_release_production.yml b/.github/workflows/firmware_release_production.yml index affa6f3..d0e8a9f 100644 --- a/.github/workflows/firmware_release_production.yml +++ b/.github/workflows/firmware_release_production.yml @@ -3,6 +3,10 @@ name: "Firmware Production Release" on: workflow_call: inputs: + product_name: + description: "Product name for release naming" + required: true + type: string release_version: description: "Git tag version for the release" required: true @@ -13,6 +17,10 @@ on: type: string workflow_dispatch: inputs: + product_name: + description: "Product name for release naming" + required: true + type: string release_version: description: "Git tag version for the release" required: true @@ -35,15 +43,15 @@ jobs: - name: Zip artifacts for Github Release uses: vimtor/action-zip@v1 with: - files: release/knot_esp32_release_${{ inputs.action_date }}.uf2 - dest: knot_release.zip + files: release/*_release_${{ inputs.action_date }}.uf2 + dest: ${{ inputs.product_name }}_release.zip - name: Create Production Release uses: softprops/action-gh-release@v1 with: tag_name: ${{ inputs.release_version }} - name: Knot ${{ inputs.release_version }} (${{ inputs.action_date }}) - files: knot_release.zip + name: ${{ inputs.product_name }} ${{ inputs.release_version }} (${{ inputs.action_date }}) + files: ${{ inputs.product_name }}_release.zip draft: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/firmware_workflow.yml b/.github/workflows/firmware_workflow.yml index 1aa651e..6e25593 100644 --- a/.github/workflows/firmware_workflow.yml +++ b/.github/workflows/firmware_workflow.yml @@ -19,6 +19,7 @@ jobs: needs: build uses: ./.github/workflows/firmware_release_production.yml with: + product_name: "knot" release_version: ${{ needs.build.outputs.release_version }} action_date: ${{ needs.build.outputs.action_date }} secrets: inherit @@ -29,6 +30,8 @@ jobs: if: github.ref == 'refs/heads/main' || needs.build.outputs.release_version != '' needs: build uses: ./.github/workflows/firmware_release_nightly.yml + with: + product_name: "knot" secrets: inherit deploy-preview: From 78b1328c7c302378cff297ef9881c03d50d0af93 Mon Sep 17 00:00:00 2001 From: sukuwc Date: Thu, 13 Nov 2025 19:47:15 +0100 Subject: [PATCH 2/2] SUKU fix nightly workflow to download only nightly_firmware artifact MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed artifact download to be more specific: - Changed from downloading all artifacts to only nightly_firmware - Removed merge-multiple parameter (not needed for single artifact) - This prevents release_firmware artifacts from being included in nightly releases 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/firmware_release_nightly.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/firmware_release_nightly.yml b/.github/workflows/firmware_release_nightly.yml index b7ee948..2b86fcf 100644 --- a/.github/workflows/firmware_release_nightly.yml +++ b/.github/workflows/firmware_release_nightly.yml @@ -76,11 +76,11 @@ jobs: fi echo "Tag deletion process completed." - - name: Download all nightly artifacts + - name: Download nightly artifacts uses: actions/download-artifact@v4 with: - path: build/ # Path to save the downloaded artifacts - merge-multiple: true + name: nightly_firmware + path: build/ - name: Remove duplicate file (the one that does not have date in the name) run: |