From bd3313d8ee11fa303851f02acd42538d4acc40af Mon Sep 17 00:00:00 2001 From: Kaiwalya Joshi Date: Tue, 9 Jan 2024 12:48:10 -0600 Subject: [PATCH] fix: Add a manual release workflow and fix CI workflow. --- .github/workflows/ci.yaml | 18 +++++++-- .github/workflows/d2iq-relesae-images.yaml | 43 ++++++++++++++++++++++ 2 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/d2iq-relesae-images.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0327dbf3..d040b8e5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,7 +3,6 @@ name: CI # on events on: - workflow_dispatch: push: branches: - master @@ -70,14 +69,27 @@ jobs: run: sudo make test-e2e publish: name: Publish docker image + runs-on: + - ubuntu-latest permissions: contents: read packages: write - runs-on: - - ubuntu-latest needs: build if: github.event_name == 'release' && github.event.action == 'created' steps: + - name: Set up Go 1.21 + uses: actions/setup-go@v2 + with: + go-version: "1.21" + id: go + - name: Set up Go for root + run: | + sudo ln -sf `which go` `sudo which go` || true + sudo go version + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + - name: get go version + run: go version - name: Login to GHCR uses: docker/login-action@v3 with: diff --git a/.github/workflows/d2iq-relesae-images.yaml b/.github/workflows/d2iq-relesae-images.yaml new file mode 100644 index 00000000..b2a534ed --- /dev/null +++ b/.github/workflows/d2iq-relesae-images.yaml @@ -0,0 +1,43 @@ +# workflow name +name: Publish Release + +# on events +on: + workflow_dispatch: + +# jobs to run +jobs: + publish: + name: Publish docker image + runs-on: + - ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Set up Go 1.21 + uses: actions/setup-go@v2 + with: + go-version: "1.21" + id: go + - name: Set up Go for root + run: | + sudo ln -sf `which go` `sudo which go` || true + sudo go version + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + - name: get go version + run: go version + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Pushing docker images + run: sudo make push + - name: Uploading binary files + uses: actions/upload-artifact@v2 + with: + name: zookeeper-exporter + path: bin/zookeeper-exporter*