ci: generic bundle builder workflow #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Ymax Bundle | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: 'Branch name to checkout' | |
| required: true | |
| type: string | |
| pull_request: | |
| jobs: | |
| build-bundle: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event_name == 'workflow_dispatch' && inputs.branch || 'fraz/test-ymax-deploy' }} | |
| submodules: recursive | |
| - name: Clean repository | |
| run: | | |
| git clean -xdf | |
| git submodule foreach --recursive git clean -xdf | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Build project | |
| run: yarn build | |
| - name: Build Ymax bundle | |
| run: | | |
| cd multichain-testing/ymax-ops | |
| make clean && make | |
| - name: Rename and prepare bundle artifact | |
| id: prepare-artifact | |
| run: | | |
| cd packages/portfolio-deploy/dist | |
| BUNDLE_ID=$(cat ymax0.bundleId) | |
| mv bundle-ymax0.json "${BUNDLE_ID}.json" | |
| echo "bundle_id=${BUNDLE_ID}" >> $GITHUB_OUTPUT | |
| echo "Bundle ID: ${BUNDLE_ID}" | |
| - name: Upload bundle artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ymax-bundle-${{ steps.prepare-artifact.outputs.bundle_id }} | |
| path: packages/portfolio-deploy/dist/${{ steps.prepare-artifact.outputs.bundle_id }}.json |