Skip to content

Commit

Permalink
Pipeline
Browse files Browse the repository at this point in the history
Signed-off-by: Jirka Kremser <[email protected]>
  • Loading branch information
jkremser committed Nov 15, 2024
1 parent eae3390 commit f294a4a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/go-pr-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ jobs:
secrets: inherit
uses: ./.github/workflows/release-image.yaml
with:
tag: ${{ github.ref_name }}
tag: ${{ github.sha }}
releaseWithGoReleaser: false

run-e2e-tests:
needs: [ build-and-publish-images ]
Expand All @@ -80,8 +81,8 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 1
- name: Run the end to end tests
env:
OTEL_SCALER_VERSION: ${{ github.ref_name }}
OTEL_SCALER_VERSION: ${{ github.sha }}
run: make e2e-tests
34 changes: 33 additions & 1 deletion .github/workflows/release-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,25 @@ on:
type: string
required: true
description: "git tag to checkout and create the release"
releaseWithGoReleaser:
description: "use GoReleaser for full workflow of the releaser (without --snapshot and retagging)"
required: false
default: true
type: choice
options:
- true
- false
workflow_call:
inputs:
tag:
type: string
required: true
description: "git tag to checkout and create the release"
releaseWithGoReleaser:
description: "use GoReleaser for full workflow of the releaser (without --snapshot and retagging)"
required: false
default: true
type: boolean

jobs:
build-and-publish-images:
Expand Down Expand Up @@ -65,12 +78,31 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Release with goreleaser
if: "${{ inputs.releaseWithGoReleaser == true }}"
timeout-minutes: 90
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: '~> v1'
args: release --clean --timeout 90m
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMAGE_TAG: ${{ inputs.tag }}

- name: Run snapshot GoReleaser
if: "${{ inputs.releaseWithGoReleaser != true }}"
uses: goreleaser/goreleaser-action@v5
with:
version: v1.24.0
args: release --clean --snapshot --skip=validate --skip=publish --skip=sbom --skip=sign --skip=announce --release-notes /dev/null
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMAGE_TAG: ${{ inputs.tag }}

- name: Retag and push
if: "${{ inputs.releaseWithGoReleaser != true }}"
run: |
docker images
docker tag ghcr.io/${{ github.actor }}/otel-add-on:${{ inputs.tag }}-amd64 ghcr.io/${{ github.actor }}/otel-add-on:${{ inputs.tag }}
docker push ghcr.io/${{ github.actor }}/otel-add-on:${{ inputs.tag }}
echo "New container image has been published: \`ghcr.io/${{ github.actor }}/otel-add-on:${{ inputs.tag }}\` | tee -a ${GITHUB_STEP_SUMMARY}
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
uses: ./.github/workflows/release-image.yaml
with:
tag: ${{ github.ref_name }}
releaseWithGoReleaser: true

post-release-work:
runs-on: ubuntu-latest
Expand Down

0 comments on commit f294a4a

Please sign in to comment.