Skip to content

Commit

Permalink
chore: use changesets for easy releases (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
Schniz authored Aug 25, 2022
1 parent 68c4c0b commit 05bb2ac
Show file tree
Hide file tree
Showing 6 changed files with 851 additions and 2,089 deletions.
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@2.1.1/schema.json",
"changelog": [
"@svitejs/changesets-changelog-github-compact",
{ "repo": "vercel/edge-runtime" }
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["@edge-runtime/docs"]
}
13 changes: 13 additions & 0 deletions .changeset/gentle-boats-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@edge-runtime/cookies': patch
'@edge-runtime/format': patch
'@edge-runtime/jest-environment': patch
'@edge-runtime/ponyfill': patch
'@edge-runtime/primitives': patch
'edge-runtime': patch
'@edge-runtime/types': patch
'@edge-runtime/user-agent': patch
'@edge-runtime/vm': patch
---

Change release method to Changesets
59 changes: 59 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Publish

on:
push:
branches:
- main
tags:
- '!*'

env:
NODE_VERSION: '14'


concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2

- uses: ./.github/actions/install-deps
with:
node-version: ${{ env.NODE_VERSION }}

- name: Setup Cache
uses: actions/cache@v3
with:
path: |
~/.pnpm-store
node_modules/.cache/turbo
node_modules/.pnpm
key: ${{ runner.os }}-node${{ env.NODE_VERSION }}-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: '7'
run_install: |
- recursive: true
args: [--no-frozen-lockfile, --loglevel=error]
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- run: pnpm run build

- name: Create Release Pull Request
uses: changesets/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
with:
version: pnpm version:prepare
publish: pnpm version:publish
24 changes: 6 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@
"url": "https://github.com/vercel/edge-runtime/issues"
},
"devDependencies": {
"@commitlint/cli": "latest",
"@commitlint/config-conventional": "latest",
"@changesets/cli": "latest",
"@jest/types": "latest",
"@lerna-lite/cli": "latest",
"@svitejs/changesets-changelog-github-compact": "latest",
"@types/jest": "latest",
"@types/node": "12",
"c8": "latest",
Expand All @@ -88,24 +87,17 @@
"clean": "pnpm -r run clean && rm -rf ./node_modules",
"clean:build": "pnpm -r run clean:build",
"clean:node": "pnpm -r run clean:node",
"contributors": "(git-authors-cli && finepack && git add package.json && git commit -m 'build: add contributors' --no-verify) || true",
"coverage": "c8 report --reporter=text-lcov > coverage/lcov.info",
"lockfile": "pnpm install --lockfile && git add pnpm-lock.yaml && git commit -m \"build: regenerate lock\"",
"postinstall": "./node_modules/.bin/simple-git-hooks",
"postrelease": "pnpm run lockfile",
"prebuild": "pnpm -r run clean:build",
"prerelease": "pnpm -r run clean && pnpm install && pnpm run build --force && pnpm run contributors",
"release": "lerna publish --yes --sort --conventional-commits -m \"chore(release): %s\" --create-release github",
"test": "c8 -x 'packages/primitives/*' turbo run test --concurrency=1",
"update": "pnpm -r exec ncu -- --upgrade && ncu -- --upgrade",
"update:check": "pnpm -r exec ncu -- --errorLevel 2 && ncu -- --errorLevel 2"
"update:check": "pnpm -r exec ncu -- --errorLevel 2 && ncu -- --errorLevel 2",
"version:prepare": "changeset version && pnpm install --no-frozen-lockfile && git-authors-cli && finepack",
"version:publish": "changeset publish"
},
"private": true,
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"nano-staged": {
"*.{ts,tsx,md,mdx,js,jsx}": [
"prettier --write"
Expand All @@ -116,10 +108,6 @@
},
"packageManager": "pnpm@6.29.1",
"simple-git-hooks": {
"commit-msg": "./node_modules/.bin/commitlint --edit",
"pre-commit": "./node_modules/.bin/nano-staged"
},
"workspaces": [
"packages/*"
]
}
}
Loading

1 comment on commit 05bb2ac

@vercel
Copy link

@vercel vercel bot commented on 05bb2ac Aug 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

edge-runtime – ./

edge-runtime.vercel.app
edge-runtime.vercel.sh
edge-runtime-git-main.vercel.sh

Please sign in to comment.