This repository was archived by the owner on Mar 11, 2026. It is now read-only.
verifyConsensus should be view (#272) #16
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: "Publish @hyperbridge/core" | |
| on: | |
| push: | |
| tags: | |
| - "core-v*" | |
| jobs: | |
| build-and-publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: "7" | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Install Foundry | |
| uses: foundry-rs/foundry-toolchain@v1 | |
| with: | |
| version: nightly | |
| - name: Build dependencies | |
| run: pnpm --filter="@hyperbridge/core^..." build | |
| - name: Build Core | |
| run: pnpm --filter="@hyperbridge/core" build | |
| - name: Publish to npm | |
| run: | | |
| echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc | |
| pnpm --filter="@hyperbridge/core" publish --no-git-checks | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| generate-changelog: | |
| runs-on: ubuntu-latest | |
| needs: build-and-publish | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get previous tag | |
| id: previous-tag | |
| run: | | |
| CURRENT_TAG=${GITHUB_REF#refs/tags/} | |
| PREVIOUS_TAG=$(git tag -l "core-v*" --sort=-version:refname | grep -v "^${CURRENT_TAG}$" | head -n1) | |
| echo "previous_tag=${PREVIOUS_TAG}" >> $GITHUB_OUTPUT | |
| echo "current_tag=${CURRENT_TAG}" >> $GITHUB_OUTPUT | |
| echo "clean_tag=${CURRENT_TAG#core-}" >> $GITHUB_OUTPUT | |
| - name: Generate changelog | |
| id: changelog | |
| run: | | |
| CURRENT_TAG=${{ steps.previous-tag.outputs.current_tag }} | |
| PREVIOUS_TAG=${{ steps.previous-tag.outputs.previous_tag }} | |
| CLEAN_TAG=${{ steps.previous-tag.outputs.clean_tag }} | |
| echo "Generating changelog for ${CURRENT_TAG}" | |
| echo "Previous tag: ${PREVIOUS_TAG}" | |
| # If no previous tag exists, get all commits | |
| if [ -z "$PREVIOUS_TAG" ]; then | |
| COMMIT_RANGE="HEAD" | |
| else | |
| COMMIT_RANGE="${PREVIOUS_TAG}..${CURRENT_TAG}" | |
| fi | |
| # Generate changelog from commit messages | |
| CHANGELOG=$(git log --pretty=format:"* %s (%h)" $COMMIT_RANGE --reverse) | |
| # Create a more structured changelog | |
| echo "# Changelog for ${CURRENT_TAG}" > CHANGELOG.md | |
| echo "" >> CHANGELOG.md | |
| echo "## Changes" >> CHANGELOG.md | |
| echo "" >> CHANGELOG.md | |
| echo "$CHANGELOG" >> CHANGELOG.md | |
| echo "" >> CHANGELOG.md | |
| # Also create a release body | |
| echo "changelog<<EOF" >> $GITHUB_OUTPUT | |
| echo "## What's Changed" >> $GITHUB_OUTPUT | |
| echo "" >> $GITHUB_OUTPUT | |
| echo "$CHANGELOG" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.POLYTOPE_GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ steps.previous-tag.outputs.current_tag }} | |
| release_name: "@hyperbridge/core ${{ steps.previous-tag.outputs.clean_tag }}" | |
| body: ${{ steps.changelog.outputs.changelog }} | |
| draft: true | |
| prerelease: false | |
| - name: Commit and push changelog | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add CHANGELOG.md | |
| git commit -m "docs: update changelog for ${{ steps.previous-tag.outputs.current_tag }}" || exit 0 | |
| git push origin HEAD:main || true |