-
Notifications
You must be signed in to change notification settings - Fork 115
setup some release stuff #100
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 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2d54828
setup some release stuff
threepointone 0e310c3
release.yml: Use automatic GITHUB_TOKEN instead of separate secret.
kentonv 8da8f63
Use trusted publishing to npm.
kentonv 50b38fd
Move prerelease build to release.yml.
kentonv 7cc17da
Inline changeset-{version,publish}.ts into workflow.
kentonv 7740518
Tie release workflow to release environment.
kentonv 9075db8
Explicitly specify permissions on all workflows.
kentonv aec9092
Use setup-node version 24 to get newer npm automatically.
kentonv 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # Changesets | ||
|
|
||
| Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
| with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
| find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
|
||
| We have a quick list of common questions to get you started engaging with this project in | ||
| [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
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,14 @@ | ||
| { | ||
| "$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json", | ||
| "changelog": [ | ||
| "@changesets/changelog-github", | ||
| { "repo": "cloudflare/capnweb" } | ||
| ], | ||
| "commit": false, | ||
| "fixed": [], | ||
| "linked": [], | ||
| "access": "public", | ||
| "baseBranch": "main", | ||
| "updateInternalDependencies": "patch", | ||
| "ignore": [] | ||
| } |
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,5 @@ | ||
| --- | ||
| "capnweb": patch | ||
| --- | ||
|
|
||
| Trigger a first release |
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,25 @@ | ||
| name: Publish to pkg.pr.new for pre-release | ||
|
|
||
| on: | ||
| pull_request: {} | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 1 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| cache: "npm" | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Build packages | ||
| run: npm run build | ||
|
|
||
| - name: Publish to pkg.pr.new | ||
| run: npx pkg-pr-new publish | ||
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,80 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| workflow_run: | ||
| workflows: ["Test"] | ||
| branches: [main] | ||
| types: [completed] | ||
|
|
||
| jobs: | ||
| release: | ||
| permissions: | ||
| contents: write # to create release (changesets/action) | ||
| issues: write # to post issue comments (changesets/action) | ||
| pull-requests: write # to create pull request (changesets/action) | ||
| id-token: write # to use OpenID Connect token for provenance (changesets/action) | ||
|
|
||
| if: ${{ github.event.workflow_run.conclusion == 'success' && github.repository_owner == 'cloudflare' }} | ||
| timeout-minutes: 5 | ||
| runs-on: ubuntu-latest | ||
| environment: release | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 1 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
kentonv marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| cache: "npm" | ||
|
|
||
| # Ensure npm 11.5.1 or later is installed, to use trusted publishing. | ||
| # See: https://docs.npmjs.com/trusted-publishers | ||
| - name: Update npm | ||
| run: npm install -g npm@latest | ||
|
|
||
| - run: npm ci | ||
| - run: npm run build | ||
|
|
||
| - id: changesets | ||
| uses: changesets/action@v1 | ||
| with: | ||
| # The standard step is only to run `changeset version` but this does not update the | ||
| # package-lock.json file. So we also run `npm install`, which does this update. | ||
| # This is a workaround until this is handled automatically by `changeset version`. | ||
| # See https://github.com/changesets/changesets/issues/421. | ||
| version: npx changeset version && npm install | ||
| publish: npx changeset publish | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| prerelease: | ||
| if: ${{ github.event.workflow_run.conclusion == 'success' && github.repository_owner == 'cloudflare' }} | ||
| timeout-minutes: 5 | ||
| runs-on: ubuntu-latest | ||
| environment: release | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 1 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
kentonv marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| cache: "npm" | ||
|
|
||
| # Ensure npm 11.5.1 or later is installed, to use trusted publishing. | ||
| # See: https://docs.npmjs.com/trusted-publishers | ||
| - name: Update npm | ||
| run: npm install -g npm@latest | ||
|
|
||
| - run: npm ci | ||
|
|
||
| - name: Modify package.json version | ||
| run: npx tsx .github/version-script.ts | ||
|
|
||
| - run: npm run build | ||
|
|
||
| - run: npm publish --tag beta | ||
|
||
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.
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.