From b96a1239e58e7b2f86a3004c31a4ee439035e2ed Mon Sep 17 00:00:00 2001 From: "Luke Tainton (ltainton)" Date: Fri, 20 Oct 2023 19:43:15 +0100 Subject: [PATCH 1/6] fix: change to automated releases --- .github/workflows/ci.yml | 2 -- .github/workflows/docker.yml | 19 ------------------ .github/workflows/release.yml | 37 +++++++++++++++++++++++++++++++++++ renovate.json | 7 ++++++- 4 files changed, 43 insertions(+), 22 deletions(-) delete mode 100644 .github/workflows/docker.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a33cf0..ce3eb9f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,5 @@ name: CI on: - push: - branches: [main] pull_request: types: [opened, synchronize, reopened] paths-ignore: diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index 7ba55c4..0000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Build -on: - push: - branches: [main] - -jobs: - build: - name: GitHub Container Registry - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Login to GitHub Container Registry - run: echo ${{ secrets.GHCR_ACCESS_TOKEN }} | docker login ghcr.io -u luketainton --password-stdin - - name: Build image for GitHub Package Registry - run: docker build . --file Dockerfile --tag ghcr.io/luketainton/roboluke-tasks:${{ github.sha }} --tag ghcr.io/luketainton/roboluke-tasks:latest - - name: Push image to GitHub Package Registry - run: | - docker push ghcr.io/luketainton/roboluke-tasks:latest - docker push ghcr.io/luketainton/roboluke-tasks:${{ github.sha }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b4bc6d8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,37 @@ +name: Build +on: + push: + branches: [main] + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Bump version and push tag + id: tag_version + uses: mathieudutour/github-tag-action@v6.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + default_bump: minor + - name: Create a GitHub release + uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.tag_version.outputs.new_tag }} + name: ${{ steps.tag_version.outputs.new_tag }} + body: ${{ steps.tag_version.outputs.changelog }} + + publish: + name: GitHub Container Registry + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Login to GitHub Container Registry + run: echo ${{ secrets.GHCR_ACCESS_TOKEN }} | docker login ghcr.io -u luketainton --password-stdin + - name: Build image for GitHub Package Registry + run: docker build . --file Dockerfile --tag ghcr.io/luketainton/roboluke-tasks:${{ steps.tag_version.outputs.new_tag }} --tag ghcr.io/luketainton/roboluke-tasks:latest + - name: Push image to GitHub Package Registry + run: | + docker push ghcr.io/luketainton/roboluke-tasks:latest + docker push ghcr.io/luketainton/roboluke-tasks:${{ steps.tag_version.outputs.new_tag }} diff --git a/renovate.json b/renovate.json index 4eaf727..67e7daa 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,11 @@ { "extends": [ - "config:base" + "config:base", + ":semanticCommits", + ":semanticCommitTypeAll(fix)" + ], + "baseBranches": [ + "next" ], "platformCommit": true, "dependencyDashboardAutoclose": true, -- 2.47.2 From c3133bbcdad89b404d8d931a7f64ad2205bf048d Mon Sep 17 00:00:00 2001 From: "Luke Tainton (ltainton)" Date: Fri, 20 Oct 2023 19:50:19 +0100 Subject: [PATCH 2/6] fix(ci): fix issues with publishing Docker image --- .github/workflows/release.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b4bc6d8..d3fa882 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,8 @@ jobs: release: name: Release runs-on: ubuntu-latest + outputs: + new_tag: ${{ steps.tag_version.outputs.new_tag }} steps: - uses: actions/checkout@v4 - name: Bump version and push tag @@ -25,13 +27,14 @@ jobs: publish: name: GitHub Container Registry runs-on: ubuntu-latest + needs: release steps: - uses: actions/checkout@v4 - name: Login to GitHub Container Registry run: echo ${{ secrets.GHCR_ACCESS_TOKEN }} | docker login ghcr.io -u luketainton --password-stdin - name: Build image for GitHub Package Registry - run: docker build . --file Dockerfile --tag ghcr.io/luketainton/roboluke-tasks:${{ steps.tag_version.outputs.new_tag }} --tag ghcr.io/luketainton/roboluke-tasks:latest + run: docker build . --file Dockerfile --tag ghcr.io/luketainton/roboluke-tasks:${{ needs.job1.outputs.new_tag }} --tag ghcr.io/luketainton/roboluke-tasks:latest - name: Push image to GitHub Package Registry run: | docker push ghcr.io/luketainton/roboluke-tasks:latest - docker push ghcr.io/luketainton/roboluke-tasks:${{ steps.tag_version.outputs.new_tag }} + docker push ghcr.io/luketainton/roboluke-tasks:${{ needs.job1.outputs.new_tag }} -- 2.47.2 From 567efb9ec06d7e390d839059ad1cae023a383832 Mon Sep 17 00:00:00 2001 From: "Luke Tainton (ltainton)" Date: Fri, 20 Oct 2023 19:52:23 +0100 Subject: [PATCH 3/6] fix(ci): correct reference to previous CI job --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d3fa882..baad408 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,8 +33,8 @@ jobs: - name: Login to GitHub Container Registry run: echo ${{ secrets.GHCR_ACCESS_TOKEN }} | docker login ghcr.io -u luketainton --password-stdin - name: Build image for GitHub Package Registry - run: docker build . --file Dockerfile --tag ghcr.io/luketainton/roboluke-tasks:${{ needs.job1.outputs.new_tag }} --tag ghcr.io/luketainton/roboluke-tasks:latest + run: docker build . --file Dockerfile --tag ghcr.io/luketainton/roboluke-tasks:${{ needs.release.outputs.new_tag }} --tag ghcr.io/luketainton/roboluke-tasks:latest - name: Push image to GitHub Package Registry run: | docker push ghcr.io/luketainton/roboluke-tasks:latest - docker push ghcr.io/luketainton/roboluke-tasks:${{ needs.job1.outputs.new_tag }} + docker push ghcr.io/luketainton/roboluke-tasks:${{ needs.release.outputs.new_tag }} -- 2.47.2 From 9c312927bfc1edd4cf24fffcd66f65fcf95e153c Mon Sep 17 00:00:00 2001 From: "Luke Tainton (ltainton)" Date: Fri, 20 Oct 2023 21:16:52 +0100 Subject: [PATCH 4/6] chore(ci): auto-update Portainer stack on release --- .github/workflows/release.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index baad408..26e94ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,3 +38,12 @@ jobs: run: | docker push ghcr.io/luketainton/roboluke-tasks:latest docker push ghcr.io/luketainton/roboluke-tasks:${{ needs.release.outputs.new_tag }} + + deploy: + name: Update Portainer Deployment + runs-on: ubuntu-latest + steps: + - uses: fjogeleit/http-request-action@v1 + with: + url: ${{ secrets.PORTAINER_WEBHOOK_URL }} + method: POST -- 2.47.2 From d03afeb8c4d2feba3120d73c4166fbc16da03902 Mon Sep 17 00:00:00 2001 From: "Luke Tainton (ltainton)" Date: Fri, 20 Oct 2023 21:47:54 +0100 Subject: [PATCH 5/6] chore(ci): add 30s timeout to Portainer request --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 26e94ef..6518806 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,3 +47,5 @@ jobs: with: url: ${{ secrets.PORTAINER_WEBHOOK_URL }} method: POST + timeout: 30000 + preventFailureOnNoResponse: 'true' -- 2.47.2 From c419e56f0e2ec63b6e927f71da3c63e1c2e67532 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 20 Oct 2023 20:50:08 +0000 Subject: [PATCH 6/6] fix(deps): update dependency websockets to v11 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 11fbf5e..db0f9fe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -41,6 +41,6 @@ urllib3==2.0.7 virtualenv==20.24.5 webex-bot==0.4.1 webexteamssdk==1.6.1 -websockets==10.2 +websockets==11.0.3 wrapt==1.15.0 xmltodict==0.13.0 -- 2.47.2