Skip to content

Fix how version is set #1

Fix how version is set

Fix how version is set #1

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
environment: release
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main'
strategy:
matrix:
arch: [ amd64, arm64 ]
steps:
- name: Checkout
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/checkout@v4
with:
fetch-tags: 1
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: .go_version
- name: Extract version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Run build and tag with version
run: make image DOCKER_ARCH=${{ matrix.arch }} REGISTRY=gresearch VERSION=${{ steps.get_version.outputs.VERSION }}
- name: Run build and tag with latest version
run: make image DOCKER_ARCH=${{ matrix.arch }} REGISTRY=gresearch VERSION=latest
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Push to Docker Hub
run: docker images | grep 'gresearch/yunikorn' | awk '{print $1":"$2}' | xargs -I {} sh -c 'docker push {}'