From 0e52071141fec5dbceb3e0da887c8756bc042c6f Mon Sep 17 00:00:00 2001 From: 0xbadbee Date: Sun, 12 May 2024 16:02:35 +0200 Subject: [PATCH 01/21] Don't dump if no auth header --- src/handler_cloud.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/handler_cloud.c b/src/handler_cloud.c index dd543a75..f34a1d99 100644 --- a/src/handler_cloud.c +++ b/src/handler_cloud.c @@ -474,7 +474,7 @@ error_t handleCloudContent(HttpConnection *connection, const char_t *uri, const settings_t *settings = client_ctx->settings; - if (client_ctx->settings->cloud.dumpRuidAuthContentJson) + if (client_ctx->settings->cloud.dumpRuidAuthContentJson && connection->request.auth.found) { dumpRuidAuth(&tonieInfo->json, ruid, token); } From 1f8de4422daba1025019193ecd4f9d924faee8fa Mon Sep 17 00:00:00 2001 From: 0xbadbee Date: Wed, 15 May 2024 17:30:21 +0200 Subject: [PATCH 02/21] Create build_commit_web.yml --- .github/workflows/build_commit_web.yml | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/build_commit_web.yml diff --git a/.github/workflows/build_commit_web.yml b/.github/workflows/build_commit_web.yml new file mode 100644 index 00000000..4ee96845 --- /dev/null +++ b/.github/workflows/build_commit_web.yml @@ -0,0 +1,33 @@ +name: Make web and commit + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Make Web + run: make web + + - name: Configure Git + run: | + git config --global user.email "scilor@users.noreply.github.com" + git config --global user.name "SciLor" + + - name: Git status tonies-ota-backup + run: | + git status + - name: Commit and push if changed tonies-ota-backup + run: | + if [[ -n $(git status --porcelain) ]]; then + git add . + git commit -m "Update webinterface" + git pull --rebase + else + echo "No changes to commit and push." + fi From 7d5bd9272ffeefcfa1ec773709581af3c9e30199 Mon Sep 17 00:00:00 2001 From: 0xbadbee Date: Wed, 15 May 2024 17:33:06 +0200 Subject: [PATCH 03/21] Update build_commit_web.yml --- .github/workflows/build_commit_web.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_commit_web.yml b/.github/workflows/build_commit_web.yml index 4ee96845..73d70fbf 100644 --- a/.github/workflows/build_commit_web.yml +++ b/.github/workflows/build_commit_web.yml @@ -9,7 +9,9 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 + with: + submodules: recursive - name: Make Web run: make web From 5b69cb30d32cae9b449e95ffb144d4afbab9855f Mon Sep 17 00:00:00 2001 From: 0xbadbee Date: Wed, 14 Aug 2024 08:42:53 +0200 Subject: [PATCH 04/21] Add git push --- .github/workflows/build_commit_web.yml | 67 +++++++++++++++----------- 1 file changed, 40 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build_commit_web.yml b/.github/workflows/build_commit_web.yml index 73d70fbf..9f5e78ae 100644 --- a/.github/workflows/build_commit_web.yml +++ b/.github/workflows/build_commit_web.yml @@ -1,35 +1,48 @@ name: Make web and commit on: - workflow_dispatch: + workflow_dispatch: jobs: build: runs-on: ubuntu-latest - + steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Make Web - run: make web - - - name: Configure Git - run: | - git config --global user.email "scilor@users.noreply.github.com" - git config --global user.name "SciLor" - - - name: Git status tonies-ota-backup - run: | - git status - - name: Commit and push if changed tonies-ota-backup - run: | - if [[ -n $(git status --porcelain) ]]; then - git add . - git commit -m "Update webinterface" - git pull --rebase - else - echo "No changes to commit and push." - fi + - name: Checkout code + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Update teddycloud_web submodule + run: git submodule update --remote teddycloud_web + + - uses: actions/setup-node@v4 + with: + node-version: "20.11.1" + - name: Install NPM version + run: npm install -g npm@10.2.4 + + - name: Disable CI checks + run: echo "CI=false" >> $GITHUB_ENV + + - name: Make Web + run: make web + + - name: Configure Git + run: | + git config --global user.email "scilor@users.noreply.github.com" + git config --global user.name "SciLor" + + - name: Git status + run: | + git status + - name: Commit and push if changed + run: | + if [[ -n $(git status --porcelain) ]]; then + git add . + git commit -m "Update frontend (make web)" + git pull --rebase + git push + else + echo "No changes to commit and push." + fi From 64b89acfe396ba63fa201fdb3854db8e9d633f60 Mon Sep 17 00:00:00 2001 From: 0xbadbee Date: Wed, 14 Aug 2024 11:03:35 +0200 Subject: [PATCH 05/21] checkout v4 + npm update --- .github/workflows/build_commit_web.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_commit_web.yml b/.github/workflows/build_commit_web.yml index 9f5e78ae..7515785a 100644 --- a/.github/workflows/build_commit_web.yml +++ b/.github/workflows/build_commit_web.yml @@ -9,7 +9,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive @@ -20,7 +20,7 @@ jobs: with: node-version: "20.11.1" - name: Install NPM version - run: npm install -g npm@10.2.4 + run: npm install -g npm@10.8.2 - name: Disable CI checks run: echo "CI=false" >> $GITHUB_ENV From 100912153983484d9641050e6e09b75c9846e470 Mon Sep 17 00:00:00 2001 From: 0xbadbee Date: Wed, 14 Aug 2024 11:14:34 +0200 Subject: [PATCH 06/21] git status for submodule --- .github/workflows/build_commit_web.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_commit_web.yml b/.github/workflows/build_commit_web.yml index 7515785a..7218a2c2 100644 --- a/.github/workflows/build_commit_web.yml +++ b/.github/workflows/build_commit_web.yml @@ -13,8 +13,15 @@ jobs: with: submodules: recursive - - name: Update teddycloud_web submodule - run: git submodule update --remote teddycloud_web + # - name: Update teddycloud_web submodule + # run: git submodule update --remote teddycloud_web + + - name: Git status + run: | + git status + cd teddycloud_web + git status + cd .. - uses: actions/setup-node@v4 with: @@ -33,9 +40,6 @@ jobs: git config --global user.email "scilor@users.noreply.github.com" git config --global user.name "SciLor" - - name: Git status - run: | - git status - name: Commit and push if changed run: | if [[ -n $(git status --porcelain) ]]; then From d3f4e7d1df8830cad1b63265eb7380d59c853413 Mon Sep 17 00:00:00 2001 From: 0xbadbee Date: Wed, 14 Aug 2024 11:26:02 +0200 Subject: [PATCH 07/21] submodule update + submodule status --- .github/workflows/build_commit_web.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_commit_web.yml b/.github/workflows/build_commit_web.yml index 7218a2c2..0171833c 100644 --- a/.github/workflows/build_commit_web.yml +++ b/.github/workflows/build_commit_web.yml @@ -13,12 +13,13 @@ jobs: with: submodules: recursive - # - name: Update teddycloud_web submodule - # run: git submodule update --remote teddycloud_web + - name: Update teddycloud_web submodule + run: git submodule update --remote teddycloud_web - name: Git status run: | git status + git submodule status cd teddycloud_web git status cd .. From c81a48ff1f42db4970dcc48c6154ea3eafbe9a3c Mon Sep 17 00:00:00 2001 From: 0xbadbee Date: Wed, 14 Aug 2024 21:34:41 +0200 Subject: [PATCH 08/21] Create publish_docker_matrix.yml --- .github/workflows/publish_docker_matrix.yml | 34 +++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/publish_docker_matrix.yml diff --git a/.github/workflows/publish_docker_matrix.yml b/.github/workflows/publish_docker_matrix.yml new file mode 100644 index 00000000..7e0a773b --- /dev/null +++ b/.github/workflows/publish_docker_matrix.yml @@ -0,0 +1,34 @@ +name: Docker Image Publish Matrix (All) + +on: + workflow_dispatch: + workflow_run: + workflows: ["Make web and commit"] + types: + - completed + push: + branches: + - master + - develop + tags: + - tc_nightly* + - tc_v*.*.* + pull_request: + branches: [ "master", "develop" ] + +jobs: + pseodo_trigger: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Discover Workflows + id: discover_workflows + run: | + # Find all YAML files in the .github/workflows directory that start with "publish_docker_matrix_" + workflows=$(find .github/workflows -name 'publish_docker_matrix_*.yml' -exec basename {} \;) + echo "Found workflows: $workflows" + # Convert to JSON array + matrix_json=$(echo "$workflows" | tr ' ' '\n' | sed 's/^/"/;s/$/"/' | paste -sd, - | sed 's/^/[ /;s/$/ ]/') + echo "matrix_json=$matrix_json" >> $GITHUB_ENV From 39d4ea4871c93d5a5084acdd131f65e515dbb894 Mon Sep 17 00:00:00 2001 From: 0xbadbee Date: Wed, 14 Aug 2024 21:36:36 +0200 Subject: [PATCH 09/21] Update publish_docker_matrix_alpine.yml --- .../workflows/publish_docker_matrix_alpine.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish_docker_matrix_alpine.yml b/.github/workflows/publish_docker_matrix_alpine.yml index 375e1f82..54ebacae 100644 --- a/.github/workflows/publish_docker_matrix_alpine.yml +++ b/.github/workflows/publish_docker_matrix_alpine.yml @@ -2,15 +2,10 @@ name: Docker Image Publish Matrix (Alpine) on: workflow_dispatch: - push: - branches: - - master - - develop - tags: - - tc_nightly* - - tc_v*.*.* - pull_request: - branches: [ "master", "develop" ] + workflow_run: + workflows: ["Docker Image Publish Matrix (All)"] + types: + - completed # permissions are needed if pushing to ghcr.io permissions: @@ -182,4 +177,4 @@ jobs: - name: Inspect image if: ${{ github.event_name != 'pull_request' }} run: | - docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.teddycloud_meta.outputs.version }} \ No newline at end of file + docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.teddycloud_meta.outputs.version }} From 01260fdd5a99311da9ec9a7103e21c8e112d2797 Mon Sep 17 00:00:00 2001 From: 0xbadbee Date: Wed, 14 Aug 2024 22:14:40 +0200 Subject: [PATCH 10/21] Update publish_docker_matrix.yml --- .github/workflows/publish_docker_matrix.yml | 33 +++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish_docker_matrix.yml b/.github/workflows/publish_docker_matrix.yml index 7e0a773b..5a69c603 100644 --- a/.github/workflows/publish_docker_matrix.yml +++ b/.github/workflows/publish_docker_matrix.yml @@ -2,10 +2,8 @@ name: Docker Image Publish Matrix (All) on: workflow_dispatch: - workflow_run: - workflows: ["Make web and commit"] - types: - - completed + workflow_call: + push: branches: - master @@ -17,8 +15,10 @@ on: branches: [ "master", "develop" ] jobs: - pseodo_trigger: + generate-workflows-list: runs-on: ubuntu-latest + outputs: + matrix_json: ${{ steps.discover_workflows.outputs.matrix_json }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -32,3 +32,26 @@ jobs: # Convert to JSON array matrix_json=$(echo "$workflows" | tr ' ' '\n' | sed 's/^/"/;s/$/"/' | paste -sd, - | sed 's/^/[ /;s/$/ ]/') echo "matrix_json=$matrix_json" >> $GITHUB_ENV + + trigger-workflows: + needs: generate-workflows-list + runs-on: ubuntu-latest + strategy: + matrix: + workflow: ${{ fromJson(needs.generate-workflows-list.outputs.matrix_json) }} + + steps: + - name: Trigger Workflows + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ github.repository }} + BRANCH: ${{ github.ref_name }} + run: | + workflow_file="${{ matrix.workflow }}" + echo "Triggering workflow $workflow_file" + + curl -X POST \ + -H "Authorization: token $GITHUB_TOKEN" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/$REPO/actions/workflows/$workflow_file/dispatches \ + -d "{\"ref\":\"$BRANCH\"}" From d4a331357eda03765a302d8de474e6b9d5d3f779 Mon Sep 17 00:00:00 2001 From: 0xbadbee Date: Wed, 14 Aug 2024 22:17:12 +0200 Subject: [PATCH 11/21] Update publish_docker_matrix_alpine.yml --- .github/workflows/publish_docker_matrix_alpine.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish_docker_matrix_alpine.yml b/.github/workflows/publish_docker_matrix_alpine.yml index 54ebacae..6ac1ac12 100644 --- a/.github/workflows/publish_docker_matrix_alpine.yml +++ b/.github/workflows/publish_docker_matrix_alpine.yml @@ -2,6 +2,7 @@ name: Docker Image Publish Matrix (Alpine) on: workflow_dispatch: + workflow_call: workflow_run: workflows: ["Docker Image Publish Matrix (All)"] types: From 5970c1594ba1b56a0cd06f9677c802a467407c19 Mon Sep 17 00:00:00 2001 From: 0xbadbee Date: Wed, 14 Aug 2024 22:17:33 +0200 Subject: [PATCH 12/21] Update publish_docker_matrix_debian.yml --- .../workflows/publish_docker_matrix_debian.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish_docker_matrix_debian.yml b/.github/workflows/publish_docker_matrix_debian.yml index ace91ab6..e4b367d7 100644 --- a/.github/workflows/publish_docker_matrix_debian.yml +++ b/.github/workflows/publish_docker_matrix_debian.yml @@ -2,15 +2,11 @@ name: Docker Image Publish Matrix (Debian) on: workflow_dispatch: - push: - branches: - - master - - develop - tags: - - tc_nightly* - - tc_v*.*.* - pull_request: - branches: [ "master", "develop" ] + workflow_call: + workflow_run: + workflows: ["Docker Image Publish Matrix (All)"] + types: + - completed # permissions are needed if pushing to ghcr.io permissions: @@ -182,4 +178,4 @@ jobs: - name: Inspect image if: ${{ github.event_name != 'pull_request' }} run: | - docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.teddycloud_meta.outputs.version }} \ No newline at end of file + docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.teddycloud_meta.outputs.version }} From d958e08e5d0f3f7f1c7f7337694c2f579dfe8e2f Mon Sep 17 00:00:00 2001 From: 0xbadbee Date: Wed, 14 Aug 2024 22:17:51 +0200 Subject: [PATCH 13/21] Update publish_docker_matrix_ubuntu.yml --- .../workflows/publish_docker_matrix_ubuntu.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish_docker_matrix_ubuntu.yml b/.github/workflows/publish_docker_matrix_ubuntu.yml index e3026627..3c860c39 100644 --- a/.github/workflows/publish_docker_matrix_ubuntu.yml +++ b/.github/workflows/publish_docker_matrix_ubuntu.yml @@ -2,15 +2,11 @@ name: Docker Image Publish Matrix (Ubuntu) on: workflow_dispatch: - push: - branches: - - master - - develop - tags: - - tc_nightly* - - tc_v*.*.* - pull_request: - branches: [ "master", "develop" ] + workflow_call: + workflow_run: + workflows: ["Docker Image Publish Matrix (All)"] + types: + - completed # permissions are needed if pushing to ghcr.io permissions: @@ -198,4 +194,4 @@ jobs: - name: Inspect image if: ${{ github.event_name != 'pull_request' }} run: | - docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.teddycloud_meta.outputs.version }} \ No newline at end of file + docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.teddycloud_meta.outputs.version }} From 37a78c4d124cab055a8284408e3b2a6cf0361566 Mon Sep 17 00:00:00 2001 From: 0xbadbee Date: Wed, 14 Aug 2024 22:20:10 +0200 Subject: [PATCH 14/21] Update publish_docker_matrix.yml --- .github/workflows/publish_docker_matrix.yml | 30 +++------------------ 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/.github/workflows/publish_docker_matrix.yml b/.github/workflows/publish_docker_matrix.yml index 5a69c603..c308d883 100644 --- a/.github/workflows/publish_docker_matrix.yml +++ b/.github/workflows/publish_docker_matrix.yml @@ -3,6 +3,10 @@ name: Docker Image Publish Matrix (All) on: workflow_dispatch: workflow_call: + workflow_run: + workflows: ["Make web and commit"] + types: + - completed push: branches: @@ -20,9 +24,6 @@ jobs: outputs: matrix_json: ${{ steps.discover_workflows.outputs.matrix_json }} steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Discover Workflows id: discover_workflows run: | @@ -32,26 +33,3 @@ jobs: # Convert to JSON array matrix_json=$(echo "$workflows" | tr ' ' '\n' | sed 's/^/"/;s/$/"/' | paste -sd, - | sed 's/^/[ /;s/$/ ]/') echo "matrix_json=$matrix_json" >> $GITHUB_ENV - - trigger-workflows: - needs: generate-workflows-list - runs-on: ubuntu-latest - strategy: - matrix: - workflow: ${{ fromJson(needs.generate-workflows-list.outputs.matrix_json) }} - - steps: - - name: Trigger Workflows - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - REPO: ${{ github.repository }} - BRANCH: ${{ github.ref_name }} - run: | - workflow_file="${{ matrix.workflow }}" - echo "Triggering workflow $workflow_file" - - curl -X POST \ - -H "Authorization: token $GITHUB_TOKEN" \ - -H "Accept: application/vnd.github.v3+json" \ - https://api.github.com/repos/$REPO/actions/workflows/$workflow_file/dispatches \ - -d "{\"ref\":\"$BRANCH\"}" From 666622e3eb5c19ba2693b1e2de63b75add774bb3 Mon Sep 17 00:00:00 2001 From: 0xbadbee Date: Wed, 14 Aug 2024 22:20:38 +0200 Subject: [PATCH 15/21] Update build_commit_web.yml --- .github/workflows/build_commit_web.yml | 62 +++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_commit_web.yml b/.github/workflows/build_commit_web.yml index 0171833c..13c90c29 100644 --- a/.github/workflows/build_commit_web.yml +++ b/.github/workflows/build_commit_web.yml @@ -13,8 +13,46 @@ jobs: with: submodules: recursive - - name: Update teddycloud_web submodule - run: git submodule update --remote teddycloud_web + - name: Debug - List all branches in parent and submodule + run: | + echo "Listing branches in parent repository:" + git branch -a + + echo "Listing branches in teddycloud_web submodule:" + cd teddycloud_web + git branch -a + cd .. + + - name: Checkout the same branch for teddycloud_web + run: | + # Get the current branch of the parent project + PARENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) + + # Navigate into the submodule directory + cd teddycloud_web + + # Fetch all branches from the remote in case it's not already available + git fetch origin + + echo "Listing branches in teddycloud_web submodule:" + git branch -a + + # Fetch the specific branch from the remote if it doesn't exist locally + if git show-ref --verify --quiet refs/heads/$PARENT_BRANCH; then + git checkout $PARENT_BRANCH + else + # Check if the branch exists on the remote and fetch it + if git ls-remote --heads origin $PARENT_BRANCH | grep -q $PARENT_BRANCH; then + git fetch origin $PARENT_BRANCH:$PARENT_BRANCH + git checkout $PARENT_BRANCH + else + echo "Branch '$PARENT_BRANCH' does not exist in the submodule. Exiting." + exit 1 + fi + fi + + # Navigate back to the parent directory + cd .. - name: Git status run: | @@ -51,3 +89,23 @@ jobs: else echo "No changes to commit and push." fi + + - name: Get current branch for next step + id: get_branch + run: echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV + + - name: Trigger publish_docker_matrix.yml + uses: actions/github-script@v6 + with: + script: | + const owner = context.repo.owner; + const repo = context.repo.repo; + const event_type = 'trigger-publish-docker'; // Matches the repository_dispatch trigger + const client_payload = { "branch": process.env.branch }; + + await github.repos.createDispatchEvent({ + owner, + repo, + event_type, + client_payload + }); From 1dbce70eff84ebde4888e8ffeeaad336eff106ea Mon Sep 17 00:00:00 2001 From: 0xbadbee Date: Wed, 14 Aug 2024 22:31:27 +0200 Subject: [PATCH 16/21] Update publish_docker_matrix.yml --- .github/workflows/publish_docker_matrix.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/publish_docker_matrix.yml b/.github/workflows/publish_docker_matrix.yml index c308d883..3c8414d3 100644 --- a/.github/workflows/publish_docker_matrix.yml +++ b/.github/workflows/publish_docker_matrix.yml @@ -3,20 +3,6 @@ name: Docker Image Publish Matrix (All) on: workflow_dispatch: workflow_call: - workflow_run: - workflows: ["Make web and commit"] - types: - - completed - - push: - branches: - - master - - develop - tags: - - tc_nightly* - - tc_v*.*.* - pull_request: - branches: [ "master", "develop" ] jobs: generate-workflows-list: From d8e89da201b2f4876f1b1be0c3897174ce9fcddf Mon Sep 17 00:00:00 2001 From: 0xbadbee Date: Wed, 14 Aug 2024 22:31:40 +0200 Subject: [PATCH 17/21] Update publish_docker_matrix_alpine.yml --- .github/workflows/publish_docker_matrix_alpine.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish_docker_matrix_alpine.yml b/.github/workflows/publish_docker_matrix_alpine.yml index 6ac1ac12..4f3a760f 100644 --- a/.github/workflows/publish_docker_matrix_alpine.yml +++ b/.github/workflows/publish_docker_matrix_alpine.yml @@ -3,10 +3,16 @@ name: Docker Image Publish Matrix (Alpine) on: workflow_dispatch: workflow_call: - workflow_run: - workflows: ["Docker Image Publish Matrix (All)"] - types: - - completed + + push: + branches: + - master + - develop + tags: + - tc_nightly* + - tc_v*.*.* + pull_request: + branches: [ "master", "develop" ] # permissions are needed if pushing to ghcr.io permissions: From 8fc6683c1167e35fa3215a25b85ff6e05f41460c Mon Sep 17 00:00:00 2001 From: 0xbadbee Date: Wed, 14 Aug 2024 22:31:52 +0200 Subject: [PATCH 18/21] Update publish_docker_matrix_debian.yml --- .github/workflows/publish_docker_matrix_debian.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish_docker_matrix_debian.yml b/.github/workflows/publish_docker_matrix_debian.yml index e4b367d7..125d61da 100644 --- a/.github/workflows/publish_docker_matrix_debian.yml +++ b/.github/workflows/publish_docker_matrix_debian.yml @@ -3,10 +3,16 @@ name: Docker Image Publish Matrix (Debian) on: workflow_dispatch: workflow_call: - workflow_run: - workflows: ["Docker Image Publish Matrix (All)"] - types: - - completed + + push: + branches: + - master + - develop + tags: + - tc_nightly* + - tc_v*.*.* + pull_request: + branches: [ "master", "develop" ] # permissions are needed if pushing to ghcr.io permissions: From fcefb2d7511f23c4e34baafde535992288cbb1ae Mon Sep 17 00:00:00 2001 From: 0xbadbee Date: Wed, 14 Aug 2024 22:32:03 +0200 Subject: [PATCH 19/21] Update publish_docker_matrix_ubuntu.yml --- .github/workflows/publish_docker_matrix_ubuntu.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish_docker_matrix_ubuntu.yml b/.github/workflows/publish_docker_matrix_ubuntu.yml index 3c860c39..f5f5e2c4 100644 --- a/.github/workflows/publish_docker_matrix_ubuntu.yml +++ b/.github/workflows/publish_docker_matrix_ubuntu.yml @@ -3,10 +3,16 @@ name: Docker Image Publish Matrix (Ubuntu) on: workflow_dispatch: workflow_call: - workflow_run: - workflows: ["Docker Image Publish Matrix (All)"] - types: - - completed + + push: + branches: + - master + - develop + tags: + - tc_nightly* + - tc_v*.*.* + pull_request: + branches: [ "master", "develop" ] # permissions are needed if pushing to ghcr.io permissions: From d2434e2e2cd3f5c5f9b0853ef6f05c0e6348370e Mon Sep 17 00:00:00 2001 From: 0xbadbee Date: Wed, 14 Aug 2024 22:43:04 +0200 Subject: [PATCH 20/21] Another test --- .github/workflows/publish_docker_matrix.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/publish_docker_matrix.yml b/.github/workflows/publish_docker_matrix.yml index 3c8414d3..02bffd65 100644 --- a/.github/workflows/publish_docker_matrix.yml +++ b/.github/workflows/publish_docker_matrix.yml @@ -10,6 +10,9 @@ jobs: outputs: matrix_json: ${{ steps.discover_workflows.outputs.matrix_json }} steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Discover Workflows id: discover_workflows run: | @@ -19,3 +22,12 @@ jobs: # Convert to JSON array matrix_json=$(echo "$workflows" | tr ' ' '\n' | sed 's/^/"/;s/$/"/' | paste -sd, - | sed 's/^/[ /;s/$/ ]/') echo "matrix_json=$matrix_json" >> $GITHUB_ENV + + - name: Trigger Workflow Debian + uses: ./.github/workflows/publish_docker_matrix_debian.yml + + - name: Trigger Workflow Ubuntu + uses: ./.github/workflows/publish_docker_matrix_ubuntu.yml + + - name: Trigger Workflow Alpine + uses: ./.github/workflows/publish_docker_matrix_alpine.yml From 8e82613f2cadd3e317a162d8061f14c6cf308afb Mon Sep 17 00:00:00 2001 From: SciLor Date: Wed, 14 Aug 2024 21:06:47 +0000 Subject: [PATCH 21/21] sync with dev --- .github/workflows/build_commit_web.yml | 3 ++ .github/workflows/publish_docker_matrix.yml | 42 +++++++------------ .../publish_docker_matrix_alpine.yml | 10 ----- .../publish_docker_matrix_debian.yml | 10 ----- .../publish_docker_matrix_ubuntu.yml | 10 ----- 5 files changed, 19 insertions(+), 56 deletions(-) diff --git a/.github/workflows/build_commit_web.yml b/.github/workflows/build_commit_web.yml index 13c90c29..f71aa27e 100644 --- a/.github/workflows/build_commit_web.yml +++ b/.github/workflows/build_commit_web.yml @@ -109,3 +109,6 @@ jobs: event_type, client_payload }); + + build_docker: + uses: ./.github/workflows/publish_docker_matrix.yml \ No newline at end of file diff --git a/.github/workflows/publish_docker_matrix.yml b/.github/workflows/publish_docker_matrix.yml index 02bffd65..c6218157 100644 --- a/.github/workflows/publish_docker_matrix.yml +++ b/.github/workflows/publish_docker_matrix.yml @@ -4,30 +4,20 @@ on: workflow_dispatch: workflow_call: -jobs: - generate-workflows-list: - runs-on: ubuntu-latest - outputs: - matrix_json: ${{ steps.discover_workflows.outputs.matrix_json }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Discover Workflows - id: discover_workflows - run: | - # Find all YAML files in the .github/workflows directory that start with "publish_docker_matrix_" - workflows=$(find .github/workflows -name 'publish_docker_matrix_*.yml' -exec basename {} \;) - echo "Found workflows: $workflows" - # Convert to JSON array - matrix_json=$(echo "$workflows" | tr ' ' '\n' | sed 's/^/"/;s/$/"/' | paste -sd, - | sed 's/^/[ /;s/$/ ]/') - echo "matrix_json=$matrix_json" >> $GITHUB_ENV - - - name: Trigger Workflow Debian - uses: ./.github/workflows/publish_docker_matrix_debian.yml + push: + branches: + - master + - develop + tags: + - tc_nightly* + - tc_v*.*.* + pull_request: + branches: [ "master", "develop" ] - - name: Trigger Workflow Ubuntu - uses: ./.github/workflows/publish_docker_matrix_ubuntu.yml - - - name: Trigger Workflow Alpine - uses: ./.github/workflows/publish_docker_matrix_alpine.yml +jobs: + debian: + uses: ./.github/workflows/publish_docker_matrix_debian.yml + ubuntu: + uses: ./.github/workflows/publish_docker_matrix_ubuntu.yml + alpine: + uses: ./.github/workflows/publish_docker_matrix_alpine.yml \ No newline at end of file diff --git a/.github/workflows/publish_docker_matrix_alpine.yml b/.github/workflows/publish_docker_matrix_alpine.yml index 4f3a760f..789b1caf 100644 --- a/.github/workflows/publish_docker_matrix_alpine.yml +++ b/.github/workflows/publish_docker_matrix_alpine.yml @@ -4,16 +4,6 @@ on: workflow_dispatch: workflow_call: - push: - branches: - - master - - develop - tags: - - tc_nightly* - - tc_v*.*.* - pull_request: - branches: [ "master", "develop" ] - # permissions are needed if pushing to ghcr.io permissions: packages: write diff --git a/.github/workflows/publish_docker_matrix_debian.yml b/.github/workflows/publish_docker_matrix_debian.yml index 125d61da..1009190e 100644 --- a/.github/workflows/publish_docker_matrix_debian.yml +++ b/.github/workflows/publish_docker_matrix_debian.yml @@ -4,16 +4,6 @@ on: workflow_dispatch: workflow_call: - push: - branches: - - master - - develop - tags: - - tc_nightly* - - tc_v*.*.* - pull_request: - branches: [ "master", "develop" ] - # permissions are needed if pushing to ghcr.io permissions: packages: write diff --git a/.github/workflows/publish_docker_matrix_ubuntu.yml b/.github/workflows/publish_docker_matrix_ubuntu.yml index f5f5e2c4..e8037c36 100644 --- a/.github/workflows/publish_docker_matrix_ubuntu.yml +++ b/.github/workflows/publish_docker_matrix_ubuntu.yml @@ -4,16 +4,6 @@ on: workflow_dispatch: workflow_call: - push: - branches: - - master - - develop - tags: - - tc_nightly* - - tc_v*.*.* - pull_request: - branches: [ "master", "develop" ] - # permissions are needed if pushing to ghcr.io permissions: packages: write