Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix git action to raise PRs to update gosdk #1313

Merged
merged 12 commits into from
Dec 10, 2023
26 changes: 19 additions & 7 deletions .github/workflows/sdk-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ concurrency:

on:
push:
branches: [ master, staging, qa, sprint-* ]
tags:
- 'v*.*.*'
branches: [ master, staging, qa, sprint-*]
workflow_dispatch:
inputs:
version:
description: '0Chain SDK version'
required: true
base:
description: the target branch to which PRs should be raised
default: sprint-1.11
required: true

env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
Expand All @@ -34,19 +36,29 @@ jobs:
fail-fast: false
max-parallel: 1
matrix:
repo: [0nft, 0box, 0dns, zwalletcli, zboxcli, blobber, zs3server, s3-migration, token_bridge_authserver ]
repo: [0box, 0dns, zwalletcli, zboxcli, blobber, zs3server, s3-migration, token_bridge_authserver ]
needs: [ release ]
runs-on: [self-hosted, build]
steps:
- name: Extract branch or version name
shell: bash
run: |
GITHUB_REF=$(echo $GITHUB_REF | sed -e "s#refs/heads/##g")
echo $GITHUB_REF
echo ${{ github.event_name }}
echo "branch=${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || '$GITHUB_REF' }}" >> $GITHUB_ENV
echo "base=${{ github.event_name == 'workflow_dispatch' && github.event.inputs.base || '$GITHUB_REF' }}" >> $GITHUB_ENV
id: extract_branch

- name: Create PR on ${{ matrix.repo }}
uses: convictional/trigger-workflow-and-wait@v1.3.0
uses: convictional/trigger-workflow-and-wait@v1.6.1
with:
owner: 0chain
repo: ${{ matrix.repo }}
ref: ${{ github.head_ref || github.ref_name }}
ref: staging
github_token: ${{ secrets.GOSDK }}
workflow_file_name: gosdk.yml
inputs: ${{ needs.build.outputs.SDK }}
client_payload: '{"gosdk": "${{ env.branch }}", "base": "${{ env.base }}"}'
propagate_failure: true
trigger_workflow: true
wait_workflow: true
Loading