-
Notifications
You must be signed in to change notification settings - Fork 555
feat: add npm beta release workflow #7473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cbbf4ed
feat: add preview release workflows for NPM and Rust
paulbalaji c011ab2
test: temporarily trigger npm-beta-release on push
paulbalaji 3c82951
Revert "test: temporarily trigger npm-beta-release on push"
paulbalaji 326cbc8
feat: add changeset check to npm-beta-release workflow
paulbalaji 512b474
CR andrey
paulbalaji 3ad1244
test: add dummy changeset
paulbalaji 31d942b
Revert "test: add dummy changeset"
paulbalaji File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| name: NPM Beta Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| snapshot_tag: | ||
| description: 'NPM dist-tag for the beta release' | ||
| required: true | ||
| default: 'beta' | ||
| type: choice | ||
| options: | ||
| - beta | ||
| - alpha | ||
| - rc | ||
| - preview | ||
|
|
||
| concurrency: | ||
| group: npm-beta-release | ||
| cancel-in-progress: false | ||
|
|
||
| env: | ||
| LOG_FORMAT: PRETTY | ||
| TURBO_TELEMETRY_DISABLED: 1 | ||
| TURBO_API: https://cache.depot.dev | ||
| TURBO_TOKEN: ${{ secrets.DEPOT_TURBO_TOKEN }} | ||
| TURBO_TEAM: ${{ secrets.DEPOT_ORG_ID }} | ||
|
|
||
| jobs: | ||
| beta-release: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| id-token: write | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| submodules: recursive | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| registry-url: 'https://registry.npmjs.org' | ||
|
|
||
| - name: Check for changesets | ||
| run: | | ||
| CHANGESET_COUNT=$(find .changeset -name "*.md" ! -name "README.md" ! -name "config.json" 2>/dev/null | wc -l | tr -d ' ') | ||
| if [ "$CHANGESET_COUNT" -eq 0 ]; then | ||
paulbalaji marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| echo "::error::No pending changesets found. Beta releases require pending changeset files." | ||
| echo "" | ||
| echo "To create a beta release:" | ||
| echo "1. Add a changeset: yarn changeset" | ||
| echo "2. Commit the changeset file" | ||
| echo "3. Run this workflow again" | ||
| exit 1 | ||
| fi | ||
| echo "Found $CHANGESET_COUNT changeset(s)" | ||
|
|
||
| - name: Install dependencies | ||
| run: yarn install --immutable | ||
|
|
||
| - name: Create snapshot versions | ||
| run: yarn changeset version --snapshot ${{ inputs.snapshot_tag }} | ||
|
|
||
| - name: Get snapshot version | ||
| id: version | ||
| run: | | ||
| SNAPSHOT_VERSION=$(node -p "require('./typescript/sdk/package.json').version") | ||
| echo "snapshot=$SNAPSHOT_VERSION" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Build packages | ||
| run: yarn build | ||
|
|
||
| - name: Publish beta packages | ||
| run: yarn changeset publish --tag ${{ inputs.snapshot_tag }} --no-git-tag | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| NPM_CONFIG_PROVENANCE: true | ||
|
|
||
| - name: Summary | ||
| run: | | ||
| echo "### Beta Release Published" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "**Version:** \`${{ steps.version.outputs.snapshot }}\`" >> $GITHUB_STEP_SUMMARY | ||
| echo "**NPM Tag:** \`${{ inputs.snapshot_tag }}\`" >> $GITHUB_STEP_SUMMARY | ||
| echo "**Branch:** \`${{ github.ref_name }}\`" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "Install with:" >> $GITHUB_STEP_SUMMARY | ||
| echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY | ||
| echo "npm install @hyperlane-xyz/sdk@${{ inputs.snapshot_tag }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "npm install @hyperlane-xyz/cli@${{ inputs.snapshot_tag }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | ||
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.