chore: release npm packages #3064
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: check-warp-deploy | |
| on: | |
| # Triggers the workflow on pull request events | |
| pull_request: | |
| jobs: | |
| check-warp-deploy: | |
| permissions: | |
| # require PR write perms to be able to comment on the PR | |
| pull-requests: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Skip token generation for fork PRs (they don't have access to secrets) | |
| - name: Generate GitHub App Token | |
| id: generate-token | |
| if: github.event.pull_request.head.repo.full_name == github.repository | |
| uses: actions/create-github-app-token@v2 | |
| with: | |
| app-id: ${{ secrets.HYPER_GONK_APP_ID }} | |
| private-key: ${{ secrets.HYPER_GONK_PRIVATE_KEY }} | |
| - uses: actions/checkout@v7 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version-file: .nvmrc | |
| - name: Determine Hyperlane package version | |
| id: hyperlane-version | |
| run: | | |
| VERSION="$(jq -r '.dependencies["@hyperlane-xyz/sdk"] // .devDependencies["@hyperlane-xyz/sdk"] // empty' package.json)" | |
| if [ -z "$VERSION" ]; then | |
| echo "Missing @hyperlane-xyz/sdk dependency" | |
| exit 1 | |
| fi | |
| if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$ ]]; then | |
| echo "Expected exact semver @hyperlane-xyz/sdk version, got $VERSION" | |
| exit 1 | |
| fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Install Hyperlane CLI | |
| env: | |
| HYPERLANE_CLI_VERSION: ${{ steps.hyperlane-version.outputs.version }} | |
| run: | | |
| if ! npm view "@hyperlane-xyz/cli@${HYPERLANE_CLI_VERSION}" version >/dev/null 2>&1; then | |
| echo "No published @hyperlane-xyz/cli version ${HYPERLANE_CLI_VERSION}" | |
| exit 1 | |
| fi | |
| npm i -g "@hyperlane-xyz/cli@${HYPERLANE_CLI_VERSION}" | |
| - name: Determine Base & Head SHA | |
| id: determine-base-sha | |
| run: | | |
| echo "base_sha=${{ github.event.pull_request.base.sha }}" >> $GITHUB_OUTPUT | |
| echo "current_sha=${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT | |
| - name: Build private RPC overlay registry | |
| env: | |
| # Builds a throwaway overlay registry of private RPC URLs for the | |
| # affected chains and exports its path as RPC_OVERLAY_DIR, so the | |
| # on-chain checks do not fail on flaky/paywalled public endpoints. | |
| # The committed registry metadata is never mutated. Empty on fork PRs | |
| # (no secret access) — the script no-ops then. | |
| RPC_OVERRIDES_JSON: ${{ secrets.CHECK_WARP_DEPLOY_RPC_OVERRIDES }} | |
| run: ./scripts/build-rpc-overlay.sh | |
| - name: Check Warp Deploy | |
| env: | |
| HYPERLANE_SKIP_VERSION_CHECK: "1" | |
| # Set by the overlay step above; consumed by check-warp-deploy.sh as a | |
| # second `--registry`. Empty when no overrides were provided. | |
| RPC_OVERLAY_DIR: ${{ env.RPC_OVERLAY_DIR }} | |
| # Only set PR_NUMBER for non-fork PRs (enables PR commenting) | |
| PR_NUMBER: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.number || '' }} | |
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | |
| run: | | |
| ./scripts/check-warp-deploy.sh ${{ steps.determine-base-sha.outputs.base_sha }} ${{ steps.determine-base-sha.outputs.current_sha }} |