Skip to content

Commit

Permalink
Tag latest to point to most recent release (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek-sumo authored Dec 16, 2020
1 parent 56f7b7e commit 6c41ffa
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 7 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/pre_release_builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Pre release builds

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+'

jobs:
build-image:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Extract tag
id: extract_tag
run: echo "::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/v})"
- name: Print tag
run: echo "Running pre release build for ${{ steps.extract_tag.outputs.tag }}"
- name: Build kubernetes-tools image
run: make build-image BUILD_TAG=${{ steps.extract_tag.outputs.tag }}
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push kubernetes-tools image
run: make push-image BUILD_TAG=${{ steps.extract_tag.outputs.tag }}
11 changes: 4 additions & 7 deletions .github/workflows/release_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+'

jobs:
build-image:
Expand All @@ -17,15 +14,15 @@ jobs:
id: extract_tag
run: echo "::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/v})"
- name: Print tag
run: echo "Running dev build for ${{ steps.extract_tag.outputs.tag }}"
run: echo "Running release build for ${{ steps.extract_tag.outputs.tag }}"
- name: Build kubernetes-tools image
run: make build-image BUILD_TAG=${{ steps.extract_tag.outputs.tag }}
run: make build-release-image BUILD_TAG=${{ steps.extract_tag.outputs.tag }}
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push kubernetes-tools image
run: make push-image BUILD_TAG=${{ steps.extract_tag.outputs.tag }}
- name: Push kubernetes-tools image build cache
run: make push-image-cache BUILD_TAG=${{ steps.extract_tag.outputs.tag }}
- name: Tag latest to point to most recent release
run: make tag-release-image-with-latest BUILD_TAG=${{ steps.extract_tag.outputs.tag }}
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ build-image:
--tag $(IMAGE_NAME):$(BUILD_TAG) \
.

build-release-image:
DOCKER_BUILDKIT=1 docker build \
--tag $(IMAGE_NAME):$(BUILD_TAG) \
.

tag-release-image-with-latest:
docker tag $(IMAGE_NAME):$(BUILD_TAG) $(REPO_URL):latest
docker push $(REPO_URL):latest

test-image:
./scripts/test-image.sh "$(IMAGE_NAME):$(BUILD_TAG)"

Expand Down

0 comments on commit 6c41ffa

Please sign in to comment.