Skip to content

fixes to bifrost and astar #139

fixes to bifrost and astar

fixes to bifrost and astar #139

Workflow file for this run

name: Create SDK Snapshot
on:
pull_request:
branches: ['master']
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: 🀘 Checkout
uses: actions/checkout@v4
- name: βš™οΈ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
- name: πŸ” Authenticate with NPM
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: 🧩 Install dependencies
run: npm ci --ignore-scripts
- name: πŸ–ŠοΈ Bump version
run: npm run changeset:snapshot -- --pr $PR --sha $COMMIT_SHA --output release-plan.json
env:
PR: ${{ github.event.pull_request.number }}
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
- name: πŸ› οΈ Build SDK
run: npm run build
- name: πŸš€ Publish snapshot
run: npm run changeset -- publish --no-git-tag --snapshot --tag beta
- name: βœ… Verify release plan
id: verify
run: |
cat release-plan.json
if [ $(jq '.releases | length' release-plan.json) -eq 0 ]; then
printf "\nNo new releases available :("
else
echo "upgrade_ui_deps=yes" >> $GITHUB_OUTPUT
fi
- name: ⬆️ Upload release plan
uses: actions/upload-artifact@v4
with:
name: release-plan
path: release-plan.json
outputs:
upgrade_ui_deps: ${{ steps.verify.outputs.upgrade_ui_deps }}
upgrade-ui-deps:
needs:
- release
if: needs.release.outputs.upgrade_ui_deps == 'yes'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: ⬇️ Download release plan
uses: actions/download-artifact@v4
with:
name: release-plan
- name: 🀘 Checkout hydration-ui repository
uses: actions/checkout@v4
with:
repository: 'galacticcouncil/hydration-ui'
token: ${{ secrets.TARGET_REPO_PAT }}
path: 'hydration-ui'
- name: βš™οΈ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: πŸ”§ Upgrade hydration-ui sdk packages
run: |
cd hydration-ui
jq -c '.releases[]' ../release-plan.json | while read i; do
package_name=$(jq --raw-output '.name' <<< "$i")
package_version=$(jq --raw-output '.newVersion' <<< "$i")
echo Installing $package_name@$package_version
yarn add $package_name@$package_version
done
git config user.name "GitHub Action"
git config user.email "[email protected]"
git add package.json yarn.lock
git commit -m "$(jq '.releaseMessage' ../release-plan.json)"
- name: 🧚 Open hydration-ui PR with sdk upgrade
id: cpr
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.TARGET_REPO_PAT }}
title: '🧚 SDK Preview: [${{ env.PR_TITLE }}]'
body: |
This PR was triggered by SDK upgrade no. ${{ env.PR }}
For details visit: https://github.com/galacticcouncil/sdk/pull/${{ env.PR }}
![Alt Text](https://media.tenor.com/DNCBqbguizsAAAAM/magic.gif)
branch: upgrade-sdk-pr${{ env.PR }}
base: master
path: 'hydration-ui'
draft: true
env:
PR: ${{ github.event.pull_request.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
- name: 🧚 Print hydration-ui PR details
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
echo "Pull Request Action - ${{ steps.cpr.outputs.pull-request-operation }}"
- name: 🧚 Update sdk PR with live preview link
if: ${{ steps.cpr.outputs.pull-request-operation == 'created' }}
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '🧚 Live preview: ${{ steps.cpr.outputs.pull-request-url }}'
})