Skip to content

Commit

Permalink
ci: fix release pipeline (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
hgiasac authored Sep 24, 2024
1 parent 2b36026 commit 1706e0e
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,49 @@ jobs:
tests:
uses: ./.github/workflows/test.yaml

release-image:
name: Release ndc-prometheus image
runs-on: ubuntu-latest
needs: [tests]
steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: docker-metadata
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}

- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ steps.docker-metadata.outputs.tags }}
labels: ${{ steps.docker-metadata.outputs.labels }}

build-cli-binaries:
name: build the CLI binaries
runs-on: ubuntu-latest
needs: [tests]
needs: [release-image]
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.23"
- name: build the CLI
run: |
VERSION="$GITHUB_REF_NAME" make ci-build-configuration
Expand All @@ -41,45 +74,12 @@ jobs:
if-no-files-found: error
name: artifact

release-image:
name: Release ndc-prometheus image
runs-on: ubuntu-latest
needs: [build-cli-binaries]
steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Get version from tag
id: get-version
run: |
echo "tagged_version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
shell: bash

- name: Extract metadata (tags, labels) for Docker
id: docker-metadata
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}

- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ steps.docker-metadata.outputs.tags }}
labels: ${{ steps.docker-metadata.outputs.labels }}

- name: Build connector definition
run: |
./scripts/build-manifest.sh
Expand Down

0 comments on commit 1706e0e

Please sign in to comment.