Skip to content

Commit

Permalink
chore: set up auto for versioning/release management (#749)
Browse files Browse the repository at this point in the history
* build(dependencies): add auto plugin for automatic releases/changelogs

* build(auto): configure auto release pipeline

* docs(publish): document the updated release process
  • Loading branch information
hydrosquall authored Sep 16, 2021
1 parent 3f0012e commit 8d15fe1
Show file tree
Hide file tree
Showing 7 changed files with 1,169 additions and 42 deletions.
12 changes: 12 additions & 0 deletions .autorc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"plugins": [
"npm",
"conventional-commits",
"first-time-contributor",
"released"
],
"baseBranch": "stable",
"prereleaseBranches": [
"next"
]
}
2 changes: 1 addition & 1 deletion .github/workflows/merge-dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
auto-merge: 'minor'
merge-method: 'rebase'
merge-method: 'squash'
31 changes: 17 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,39 @@ name: Publish

on:
push:
tags:
- "v*"
branches-ignore:
# No canary deploys for branches opened by dependabot
- 'dependabot/**'

jobs:
publish:
name: Publish to NPM
name: Make a release and publish to NPM

runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"

steps:
- uses: actions/checkout@v2

- name: Prepare repository
run: git fetch --unshallow --tags

- uses: actions/[email protected]
with:
registry-url: "https://registry.npmjs.org"
node-version: "15"

- name: Install Node dependencies
run: yarn --frozen-lockfile

- name: Build
run: yarn build
- name: Publish to NPM
run: npm publish

# don't use yarn run to avoid using yarnpkg registry
- name: Create release
run: |
npm run release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Test
on:
push:
branches:
- master
- next
pull_request:
branches:
- master
- next

jobs:
test:
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,9 @@ To build `vega-embed.js` and view the test examples, you must have [yarn](https:

## Release Process

To release a new version, make sure that everything works. Then run `yarn version` and bump the version number. Lastly, push to GitHub (with the release tag). GitHub Actions will build a bundle and make the [npm release](https://www.npmjs.com/package/vega-embed) automatically.
Publishing is handled by a 2-branch [pre-release process](https://intuit.github.io/auto/docs/generated/shipit#next-branch-default), configured in `publish.yml`. All changes should be based off the default `next` branch, and are published automatically.

- PRs made into the default branch that [would trigger a version bump](https://intuit.github.io/auto/docs/generated/conventional-commits) are auto-deployed to the `next` pre-release tag on NPM. The result can be installed with `npm install vega-embed/@next`.
- When merging into `next`, please use the `squash and merge` strategy.
- To release a new stable version, open a PR from `next` into `stable` using this [compare link](https://github.com/vega/vega-embed/compare/stable...next).
- When merging from `next` into `stable`, please use the `create a merge commit` strategy.
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@
"build-es5"
],
"devDependencies": {
"@auto-it/conventional-commits": "^10.32.0",
"@auto-it/first-time-contributor": "^10.32.0",
"@rollup/plugin-commonjs": "20.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.0.2",
"@types/semver": "^7.3.7",
"@wessberg/rollup-plugin-ts": "^1.3.14",
"auto": "^10.32.0",
"browser-sync": "^2.27.4",
"concurrently": "^6.2.0",
"del-cli": "^4.0.1",
Expand Down Expand Up @@ -86,6 +89,7 @@
"prettierbase": "beemo prettier '*.{css,scss,html}'",
"eslintbase": "beemo eslint .",
"format": "yarn eslintbase --fix && yarn prettierbase --write",
"lint": "yarn eslintbase && yarn prettierbase --check"
"lint": "yarn eslintbase && yarn prettierbase --check",
"release": "auto shipit"
}
}
Loading

0 comments on commit 8d15fe1

Please sign in to comment.