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/3] 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.1 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/3] 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.1 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/3] 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.1