Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/private-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Publish SDKs to OperatorStack Registry
on:
push:
tags: ["v*"]
workflow_run:
workflows: ["Release Yield"]
types: [completed]
workflow_dispatch:
inputs:
version:
Expand All @@ -21,12 +24,13 @@ concurrency:

jobs:
publish:
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event_name == 'workflow_dispatch' && format('v{0}', inputs.version) || github.ref }}
ref: ${{ github.event_name == 'workflow_dispatch' && format('v{0}', inputs.version) || github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.ref }}
- uses: actions/setup-go@v5
with:
go-version: stable
Expand All @@ -44,7 +48,11 @@ jobs:
REQUESTED_VERSION: ${{ inputs.version }}
run: |
set -euo pipefail
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
if [[ "$GITHUB_EVENT_NAME" == "workflow_run" ]]; then
tag="$(git tag --points-at HEAD --list 'v[0-9]*' --sort=-v:refname | head -n 1)"
test -n "$tag"
version="${tag#v}"
elif [[ "$GITHUB_REF" == refs/tags/v* ]]; then
version="${GITHUB_REF_NAME#v}"
else
version="$REQUESTED_VERSION"
Expand All @@ -60,6 +68,8 @@ jobs:
workload_identity_provider: ${{ vars.WIF_PROVIDER }}
service_account: ${{ vars.DEPLOYER_SA_EMAIL }}
- uses: google-github-actions/setup-gcloud@v2
with:
install_components: package-go-module

- name: Verify Go SDK and runtime
run: go test ./...
Expand Down
Loading