-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Publish via workflow with trusted publishing #3915
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
Open
nstepien
wants to merge
3
commits into
main
Choose a base branch
from
trusted-publishing
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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,77 @@ | ||
| name: Publish | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'Version to publish (e.g., 0.1.1, 0.2.0, 1.0.0)' | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| publish: | ||
| name: Publish | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: 25 | ||
| check-latest: true | ||
| registry-url: 'https://registry.npmjs.org' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm i | ||
|
|
||
| - name: Biome | ||
| run: node --run biome:ci | ||
|
|
||
| - name: Typecheck | ||
| run: node --run typecheck | ||
|
|
||
| - name: ESLint | ||
| run: node --run eslint | ||
|
|
||
| - name: Prettier | ||
| run: node --run prettier:check | ||
|
|
||
| - name: Bundle | ||
| run: node --run build | ||
|
|
||
| - name: Build website | ||
| run: node --run build:website | ||
|
|
||
| - name: Install Playwright Browsers | ||
| run: npx playwright install chromium firefox | ||
|
|
||
| - name: Test | ||
| run: node --run test | ||
| timeout-minutes: 4 | ||
|
|
||
| - name: Visual regression test | ||
| run: node --run visual | ||
|
|
||
| - name: Update version | ||
| run: | | ||
| git config user.name "${{ github.actor }}" | ||
| git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" | ||
| npm version ${{ inputs.version }} | ||
|
|
||
| # https://docs.npmjs.com/trusted-publishers | ||
| - name: Publish to npm | ||
| run: npm publish | ||
|
|
||
| - name: Push commit and tag | ||
| run: git push origin main --follow-tags | ||
|
|
||
| - name: Create GitHub Release | ||
| run: gh release create v${{ inputs.version }} --title "v${{ inputs.version }}" --generate-notes | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
This file was deleted.
Oops, something went wrong.
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
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.

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will have to double-check our branch rules, we need to allow directly pushing to
main.