From 14745a2fe05c60e73017edcad3e056887fcce1c3 Mon Sep 17 00:00:00 2001 From: VJ Patel Date: Sun, 18 Oct 2020 01:58:56 +0000 Subject: [PATCH 1/2] Automatically push docker images during release CI/CD --- .github/workflows/publish.yml | 6 ++++++ docs/contributers/RELEASES.md | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4cd166a..e74021a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,3 +23,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: ./pleasew run //scripts:pre-release + + - name: Publish Docker images + env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} + run: ./pleasew run //scripts:publish-images diff --git a/docs/contributers/RELEASES.md b/docs/contributers/RELEASES.md index 01656ba..f83d793 100644 --- a/docs/contributers/RELEASES.md +++ b/docs/contributers/RELEASES.md @@ -19,11 +19,10 @@ This lets us use `git desribe` to give us a descriptive version from any commit ## Creating a Release -1. Tag the commit you would like to release from `master` and push the tags: +1. Tag the commit you would like to release from `master` and push the tags. This will trigger a GitHub workflow that creates a pre-release and pushes Docker images: ``` git fetch --tags git tag --annotate --message "" git push origin --tags ``` -2. Build and publish the release Docker images to Docker Hub by running `./pleasew run //scripts:publish-images` -3. In the GitHub web interface, you can then promote the new pre-release to a release +2. Once satisfied, promote the new pre-release to a release. From 6d89673f3e82f7607dd301a84e5cf1c9dad61327 Mon Sep 17 00:00:00 2001 From: VJ Patel Date: Mon, 19 Oct 2020 00:52:05 +0100 Subject: [PATCH 2/2] fetch tags during pre-release --- scripts/pre-release.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/pre-release.sh b/scripts/pre-release.sh index a8a4dac..a15a8af 100755 --- a/scripts/pre-release.sh +++ b/scripts/pre-release.sh @@ -1,6 +1,7 @@ #!/bin/bash set -euo pipefail +git fetch --tags --force version=$(git describe --always) github_api_version="application/vnd.github.v3+json"