Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/README.md
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)
14 changes: 14 additions & 0 deletions .changeset/config.json
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": []
}
5 changes: 5 additions & 0 deletions .changeset/good-glasses-see.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"capnweb": patch
---

Trigger a first release
5 changes: 5 additions & 0 deletions .github/changeset-publish.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { execSync } from "node:child_process";

execSync("npx changeset publish", {
stdio: "inherit",
});
13 changes: 13 additions & 0 deletions .github/changeset-version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { execSync } from "node:child_process";

// This script is used by the `release.yml` workflow to update the version of the packages being released.
// 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.
execSync("npx changeset version", {
stdio: "inherit",
});
execSync("npm install", {
stdio: "inherit",
});
25 changes: 25 additions & 0 deletions .github/workflows/pkg-pr-new.yml
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
34 changes: 34 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Prerelease

on:
workflow_run:
workflows: ["Test"]
branches: [main]
types: [completed]

jobs:
prerelease:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.repository_owner == 'cloudflare' }}
timeout-minutes: 5
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"

- run: npm ci

- name: Modify package.json version
run: npx tsx .github/version-script.ts

- run: npm run build

- run: npm publish --tag beta
env:
NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release

on:
workflow_run:
workflows: ["Test"]
branches: [main]
types: [completed]

jobs:
release:
permissions:
contents: write

if: ${{ github.event.workflow_run.conclusion == 'success' && github.repository_owner == 'cloudflare' }}
timeout-minutes: 5
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"

- run: npm ci
- run: npm run build

- id: changesets
uses: changesets/action@v1
with:
version: npx tsx .github/changeset-version.ts
publish: npx tsx .github/changeset-publish.ts
env:
GITHUB_TOKEN: ${{ secrets.CAPNWEB_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
28 changes: 14 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Test

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
test:
Expand All @@ -14,19 +14,19 @@ jobs:
options: --user 1001

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"

- name: Install dependencies
run: npm ci
- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build
- name: Build project
run: npm run build

- name: Run tests
run: npm test
- name: Run tests
run: npm test
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//registry.npmjs.org/:_authToken=${NPM_PUBLISH_TOKEN}
Loading
Loading