Skip to content

Commit

Permalink
Add Changesets and setup pre-release and release CI (#556)
Browse files Browse the repository at this point in the history
* add changeset

* add stable branch too

* Create selfish-avocados-report.md
  • Loading branch information
shuding committed Jul 21, 2022
1 parent 8c87fc0 commit 383b869
Show file tree
Hide file tree
Showing 9 changed files with 990 additions and 21 deletions.
11 changes: 11 additions & 0 deletions .changeset/config.json
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.0.1/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [["nextra", "nextra-theme-docs", "nextra-theme-blog"]],
"linked": [],
"access": "public",
"baseBranch": "core",
"updateInternalDependencies": "patch",
"ignore": []
}
10 changes: 10 additions & 0 deletions .changeset/pre.json
@@ -0,0 +1,10 @@
{
"mode": "pre",
"tag": "beta",
"initialVersions": {
"nextra": "2.0.0-beta.6",
"nextra-theme-blog": "2.0.0-beta.6",
"nextra-theme-docs": "2.0.0-beta.6"
},
"changesets": []
}
5 changes: 5 additions & 0 deletions .changeset/selfish-avocados-report.md
@@ -0,0 +1,5 @@
---
"nextra": patch
---

Add Changesets and setup pre-release and release CI.
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,38 @@
name: Release

on:
push:
branches:
- stable
- core

jobs:
release:
if: github.repository == 'shuding/nextra'

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2.2.2
with:
version: 7

- name: Use Node.js ${{matrix.node-version}}
uses: actions/setup-node@v3
with:
node-version: ${{matrix.node-version}}
cache: pnpm

- name: Install Dependencies
run: pnpm i

- name: Create Release Pull Request or Publish to npm
uses: changesets/action@v1
with:
publish: pnpm run release
version: pnpm run version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion examples/blog/package.json
@@ -1,6 +1,6 @@
{
"name": "blog",
"version": "1.0.0",
"private": true,
"main": "index.js",
"license": "MIT",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion examples/docs/package.json
@@ -1,6 +1,6 @@
{
"name": "docs",
"version": "1.0.0",
"private": true,
"main": "index.js",
"license": "MIT",
"scripts": {
Expand Down
3 changes: 1 addition & 2 deletions examples/swr-site/package.json
@@ -1,7 +1,6 @@
{
"name": "swr-site",
"version": "1.0.0",
"description": "",
"private": true,
"main": "index.js",
"scripts": {
"dev": "next",
Expand Down
13 changes: 8 additions & 5 deletions package.json
@@ -1,21 +1,21 @@
{
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "turbo run dev",
"build": "turbo run build types",
"build": "turbo run build types --filter=\"nextra*\"",
"types": "turbo run types",
"dev:core": "turbo run dev --filter=\"nextra\"",
"dev:theme-blog": "turbo run dev --filter=\"blog\" --include-dependencies",
"dev:theme-docs": "turbo run dev --filter=\"swr-site\" --include-dependencies",
"build:core": "pnpm run build --filter=\"nextra\"",
"build:theme-blog": "pnpm run build --filter=\"nextra-theme-blog\"",
"build:theme-docs": "pnpm run build --filter=\"nextra-theme-docs\"",
"version-beta": "lerna version --preid beta",
"publish-beta": "lerna publish from-package --canary --preid beta --pre-dist-tag beta",
"version": "changeset version",
"release": "changeset publish",
"test": "turbo run test"
},
"devDependencies": {
"@changesets/cli": "^2.23.2",
"@edge-runtime/vm": "1.1.0-beta.11",
"@tailwindcss/nesting": "^0.0.0-insiders.565cd3e",
"@tailwindcss/typography": "^0.5.0",
Expand Down Expand Up @@ -43,5 +43,8 @@
"trailingComma": "none",
"arrowParens": "avoid"
},
"packageManager": "pnpm@7.3.0"
"packageManager": "pnpm@7.3.0",
"workspaces": [
"packages/*"
]
}

0 comments on commit 383b869

Please sign in to comment.