Skip to content

Commit

Permalink
chore: update workflow generate types
Browse files Browse the repository at this point in the history
  • Loading branch information
devdanco committed Oct 17, 2023
1 parent 38c38ac commit bc91a60
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/branch-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,19 @@ jobs:
version: ${{ needs.init.outputs.GLOBAL_VERSION }}
cluster_name: mangata-dev-alpha

generate-types:
name: Generate types
needs: [init, build-and-test]
uses: ./.github/workflows/reusable-generate-types.yml
secrets: inherit
with:
branch: ${{ needs.init.outputs.GIT_BRANCH }}
parachainDocker: ${{ github.event.inputs.parachainDocker }}
globalVersion: ${{ needs.init.outputs.GLOBAL_VERSION }}

run-e2e-test:
name: Run e2e tests
needs: [init, build-and-test]
needs: [init, build-and-test, generate-types]
uses: ./.github/workflows/reusable-e2e-tests.yml
secrets: inherit
with:
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/reusable-generate-types.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Reusable generate types workflow

on:
workflow_dispatch:
inputs:
branch:
description: "Branch to create in mangata-dev-kit"
type: string
required: true
parachainDocker:
description: "Name of the parachain docker reference"
type: string
required: false
default: "mangatasolutions/mangata-node:latest"
globalVersion:
description: "Set Mangata node version."
type: string
required: true
workflow_call:
inputs:
branch:
description: "Branch to create in mangata-dev-kit"
type: string
required: true
parachainDocker:
description: "Name of the parachain docker reference"
type: string
required: false
default: "mangatasolutions/mangata-node:latest"
globalVersion:
description: "Set Mangata node version."
type: string
required: true

permissions:
contents: write
id-token: write
deployments: write
checks: write

jobs:
generate-mangata-types:
runs-on: ubuntu-latest
env:
MANGATA_NODE_VERSION: ${{ inputs.globalVersion }}
PARACHAIN_DOCKER_IMAGE: ${{ inputs.parachainDocker || format('mangatasolutions/mangata-node:{0}', inputs.globalVersion) }}
BRANCH: ${{ inputs.branch }}
steps:
- uses: actions/checkout@v3

- name: Create branch ${{ env.BRANCH }} in mangata-dev-kit
uses: GuillaumeFalourd/create-other-repo-branch-action@v1.5
with:
repository_owner: mangata-finance
repository_name: mangata-dev-kit
new_branch_name: ${{ env.BRANCH }}
ignore_branch_exists: true
access_token: ${{ secrets.BOT_GITHUB_TOKEN }}

- name: Invoke workflow in mangata-dev-kit repo with inputs
uses: jonas-schievink/workflow-proxy@v1
with:
ref: ${{ env.BRANCH }}
workflow: pre-release-types.yml
repo: mangata-finance/mangata-dev-kit
token: ${{ secrets.BOT_GITHUB_TOKEN }}
inputs: '{"parachainDocker": "${{ env.PARACHAIN_DOCKER_IMAGE }}", "branch": "${{ env.BRANCH }}"}'

0 comments on commit bc91a60

Please sign in to comment.