From f41fbdba20d7b567e688725d4c31df6dfda96099 Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 22 Mar 2023 10:06:28 +0100 Subject: [PATCH 01/11] ci: add release.yml for publish container on ghcr.io --- .github/workflows/release.yml | 55 +++++++++++++++++++++++++++++++++++ CHANGELOG.md | 3 ++ Makefile | 2 +- README.md | 5 ++-- 4 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e8541ee --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,55 @@ +# Workflow trigger Event +on: + push: + # Publish semver tags as releases. + tags: ['v*.*.*'] + pull_request: + branches: [master] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build: + name: Push Docker image to GitHub Container Registry + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Setup Docker buildx + uses: docker/setup-buildx-action@v2 + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@v4 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/CHANGELOG.md b/CHANGELOG.md index e93e324..968614d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # Release Notes +## 2.0.0 + +- no changes on the code itself. We move the publishment from dockehub to ghcr.. ## 2.0.0-beta1 diff --git a/Makefile b/Makefile index d8d8fcc..b774cc4 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ user=meshcloud name=gate-resource image=$(user)/$(name) -tag=2.0.0-beta1 +tag=2.0.0 docker=docker dockerfile = Dockerfile diff --git a/README.md b/README.md index d9e199f..5aeeed7 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,13 @@ # gate-resource -[![Build Status](https://img.shields.io/docker/build/meshcloud/gate-resource.svg)](https://hub.docker.com/r/meshcloud/gate-resource/) -[![Docker Pulls](https://img.shields.io/docker/pulls/meshcloud/gate-resource.svg?maxAge=2592000)](https://hub.docker.com/r/meshcloud/gate-resource/) - A generic gate resource for Concourse CI. Allows you to model quality gates and pipeline control flow. This resource is backed by a Git repository and wraps [git-resource](https://github.com/concourse/git-resource). +A public container build of this repo is available at ghcr.io [meshcloud/gate-resource](https://github.com/meshcloud/gate-resource/pkgs/container/gate-resource). + > Contributors Welcome: This resource is new and hot off the press. We welcome your feedback and contributions! ## Example From d428a7f6da573364e63e6fde2675732a4ed10b1d Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 22 Mar 2023 10:10:44 +0100 Subject: [PATCH 02/11] ci: add release.yml for publish container on ghcr.io --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 968614d..7045811 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Release Notes ## 2.0.0 -- no changes on the code itself. We move the publishment from dockehub to ghcr.. +- no changes on the code itself. We move the publishment from dockehub to ghcr. ## 2.0.0-beta1 From 2d5d9aeb3f171df48bfeb1b5ce9de06c0e843a71 Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 22 Mar 2023 11:33:15 +0100 Subject: [PATCH 03/11] chore: remove version tag from makefile and add Git SHA hash instead of it --- CHANGELOG.md | 3 ++- Makefile | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7045811..37ebbd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ # Release Notes ## 2.0.0 -- no changes on the code itself. We move the publishment from dockehub to ghcr. +- no changes on the code itself. We now publish the container on ghcr instead of docker hub. +- We move out of beta, we've been running 2.0 without changes in production ## 2.0.0-beta1 diff --git a/Makefile b/Makefile index b774cc4..454c08e 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ user=meshcloud name=gate-resource image=$(user)/$(name) -tag=2.0.0 +tag=$(shell git log --format="%h" -n 1) docker=docker dockerfile = Dockerfile From 67c19cd8456aedb19f8b80b42e3a8985e9c565d6 Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 22 Mar 2023 11:51:24 +0100 Subject: [PATCH 04/11] chore: add badge in README for successful build --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5aeeed7..b6bd967 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # gate-resource +[![CI](https://github.com/meshcloud/gate-resource/workflows/Build/badge.svg?branch=master&event=push)](https://github.com/meshcloud/gate-resource/actions?query=workflow%3ABuild) + A generic gate resource for Concourse CI. Allows you to model quality gates and pipeline control flow. From 88e936eab2e57f81ba5c26fca8b30a8e70984b29 Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 22 Mar 2023 11:57:20 +0100 Subject: [PATCH 05/11] chore: add badge in README for successful build --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b6bd967..61a0463 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # gate-resource -[![CI](https://github.com/meshcloud/gate-resource/workflows/Build/badge.svg?branch=master&event=push)](https://github.com/meshcloud/gate-resource/actions?query=workflow%3ABuild) +[![CI](https://github.com/meshcloud/gate-resource/workflows/release.yml/badge.svg?branch=master&event=push)](https://github.com/meshcloud/gate-resource/actions/workflows/main.yml/badge.svg) A generic gate resource for Concourse CI. From 9b7d004ef868ebf9c9a05a6c8f42720b1f267125 Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 22 Mar 2023 11:58:23 +0100 Subject: [PATCH 06/11] chore: add badge in README for successful build --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 61a0463..0db809a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # gate-resource -[![CI](https://github.com/meshcloud/gate-resource/workflows/release.yml/badge.svg?branch=master&event=push)](https://github.com/meshcloud/gate-resource/actions/workflows/main.yml/badge.svg) +[![CI](https://github.com/meshcloud/gate-resource/workflows/release.yml/badge.svg?branch=master&event=push)](https://github.com/meshcloud/gate-resource/actions/workflows/release.yml/badge.svg) A generic gate resource for Concourse CI. From b878fb61209bd0750d3a5ded3ec1b4480c7cb0bb Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 22 Mar 2023 12:01:31 +0100 Subject: [PATCH 07/11] chore: add badge in README for successful build --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0db809a..ef03774 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # gate-resource -[![CI](https://github.com/meshcloud/gate-resource/workflows/release.yml/badge.svg?branch=master&event=push)](https://github.com/meshcloud/gate-resource/actions/workflows/release.yml/badge.svg) +[![CI](https://github.com/meshcloud/gate-resource/actions/workflows/release.yml/badge.svg?branch=master&event=push)](https://github.com/meshcloud/gate-resource/actions/workflows/main.yml/badge.svg) A generic gate resource for Concourse CI. From 47c83ce6bb91e70dd65704b87ad44ee3cc22ff48 Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 22 Mar 2023 12:04:54 +0100 Subject: [PATCH 08/11] chore: add badge in README for successful build --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ef03774..b982c05 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # gate-resource -[![CI](https://github.com/meshcloud/gate-resource/actions/workflows/release.yml/badge.svg?branch=master&event=push)](https://github.com/meshcloud/gate-resource/actions/workflows/main.yml/badge.svg) +[![Build](https://github.com/meshcloud/gate-resource/actions/workflows/build.yml/badge.svg)](https://github.com/meshcloud/gate-resource/actions/workflows/build.yml) A generic gate resource for Concourse CI. From b2b82215a34cf3a4424d89bc33ad2a641b919662 Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 22 Mar 2023 12:06:26 +0100 Subject: [PATCH 09/11] chore: add badge in README for successful build --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b982c05..b57ad52 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # gate-resource -[![Build](https://github.com/meshcloud/gate-resource/actions/workflows/build.yml/badge.svg)](https://github.com/meshcloud/gate-resource/actions/workflows/build.yml) +[![Build](https://github.com/meshcloud/gate-resource/actions/workflows/release.yml/badge.svg)](https://github.com/meshcloud/gate-resource/actions/workflows/release.yml) A generic gate resource for Concourse CI. From 0855e0c9d11ba8800d199ff7f89ae19dbb80e99b Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 22 Mar 2023 12:11:08 +0100 Subject: [PATCH 10/11] ci: add name: Build for the Badge name --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e8541ee..cde9681 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,3 +1,5 @@ +name: Build + # Workflow trigger Event on: push: From c8d90970522afc49039f4f5f3d2e4bc578e0d9f5 Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 22 Mar 2023 12:13:42 +0100 Subject: [PATCH 11/11] ci: change name of ci to build because of badge behaivours --- .github/workflows/{release.yml => build.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{release.yml => build.yml} (100%) diff --git a/.github/workflows/release.yml b/.github/workflows/build.yml similarity index 100% rename from .github/workflows/release.yml rename to .github/workflows/build.yml