Skip to content

Commit

Permalink
Add changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredpalmer committed Sep 29, 2020
1 parent 57487bb commit b009b3b
Show file tree
Hide file tree
Showing 5 changed files with 624 additions and 48 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/master/docs/common-questions.md)
10 changes: 10 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "formium/formik" }],
"commit": false,
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
56 changes: 19 additions & 37 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,29 @@
name: Release

on:
push:
branches:
- master

jobs:
build:
release:
runs-on: ubuntu-latest
name: Build, test, Publish

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v2
with:
node-version: 12
- run: yarn install --frozen-lockfile
- run: yarn test
env:
CI: true
- name: Potentially save npm token
run: |
([[ ! -z ${{ secrets.NPM_TOKEN }} ]] && echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc) || echo "Did not write npm token"
- name: Potentially publish canary to npm
run: |
if \
ls ~/.npmrc >/dev/null 2>&1 && \
[[ $(git describe --exact-match 2> /dev/null || :) =~ -canary ]]; \
then
yarn run lerna publish from-git --npm-tag canary --yes
else
echo "Did not publish canary"
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Potentially publish stable to npm
run: |
if \
ls ~/.npmrc >/dev/null 2>&1 && \
[[ ! $(git describe --exact-match 2> /dev/null || :) =~ -canary ]]; \
then
yarn run lerna publish from-git --yes
else
echo "Did not publish"
fi
fetch-depth: 0

- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
version: 12.x

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1

- name: Create Release Pull Request or Publish to npm
uses: changesets/action@master
with:
publish: yarn release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"name": "formik-project",
"private": true,
"devDependencies": {
"@changesets/changelog-github": "^0.2.7",
"@changesets/cli": "^2.10.3",
"@types/jest": "^26.0.14",
"cypress": "^5.2.0",
"got": "10.0.4",
Expand All @@ -23,8 +25,8 @@
"build": "lerna run build",
"prepublish": "lerna run prepublish",
"format": "prettier --write 'examples/**/*' 'packages/*/src/**/*' 'docs/src/**/*.{ts,tsx,js,jsx,md,mdx}' 'app/pages/**/*' 'packages/*/test/**/*' 'README.md'",
"publish-canary": "lerna version prerelease --preid canary --force-publish && release --pre",
"publish-stable": "lerna version --force-publish && release && node ./scripts/release-notes.js",
"changeset": "changeset",
"release": "changeset publish",
"git-reset": "git reset --hard HEAD",
"git-clean": "git clean -d -x -e node_modules -e packages -f",
"cypress": "cypress run",
Expand Down
Loading

0 comments on commit b009b3b

Please sign in to comment.