From 739659d7e1b08b729463fc13d5f75b3b57bc7546 Mon Sep 17 00:00:00 2001 From: Dimitri Koshkin Date: Thu, 22 Feb 2024 12:45:04 -0800 Subject: [PATCH] ci: add Release GHA --- .github/workflows/release.yaml | 26 ++++++++++++++++++++++++++ hack/release.sh | 4 ++-- 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000000..7cc1ab4989 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,26 @@ +name: Release +on: + push: + tags: + - "*-d2iq.*" + +# Because variables are not exported, they are not visible by child processes, e.g. make +env: + registry: ghcr.io/mesosphere + +jobs: + release: + name: Release + runs-on: + - ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Login to container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.registry }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push container image + run: | + make push-images \ No newline at end of file diff --git a/hack/release.sh b/hack/release.sh index 4a57241c53..c278d57dd2 100755 --- a/hack/release.sh +++ b/hack/release.sh @@ -26,7 +26,7 @@ set -x DO_WINDOWS_BUILD=${DO_WINDOWS_BUILD_ENV:-true} # BASE_REPO is the root path of the image repository -readonly BASE_IMAGE_REPO=gcr.io/cloud-provider-vsphere +readonly BASE_IMAGE_REPO=ghcr.io/mesosphere/cloud-provider-vsphere # Release images readonly CSI_IMAGE_RELEASE=${BASE_IMAGE_REPO}/csi/release/driver @@ -47,7 +47,7 @@ SYNCER_IMAGE_NAME= if [[ "$(git rev-parse --abbrev-ref HEAD)" =~ "master" ]]; then VERSION="$(git log -1 --format=%h)" else - VERSION="$(git describe --always 2>/dev/null)" + VERSION="$(git describe --tags --always 2>/dev/null)" fi GIT_COMMIT="$(git log -1 --format=%H)" GCR_KEY_FILE="${GCR_KEY_FILE:-}"