Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: set up auto for versioning/release management #312

Merged
merged 3 commits into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 10 additions & 0 deletions .autorc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"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'
18 changes: 14 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,33 @@ name: Publish

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

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

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

steps:
- uses: actions/checkout@v2

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

- uses: actions/[email protected]
with:
registry-url: 'https://registry.npmjs.org'

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

- run: yarn build
- run: npm publish

- run: npm run release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Test

on: [push]
on:
push:
branches:
- next
pull_request:
branches:
- next

jobs:
test:
Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ Collection of datasets used in Vega and Vega-Lite examples. This data lives at h

Common repository for example datasets used by Vega related projects. Keep changes to this repository minimal as other projects (Vega, Vega Editor, Vega-Lite, Polestar, Voyager) use this data in their tests and for examples.

The list of sources is in [SOURCES.md](https://github.com/vega/vega-datasets/blob/master/SOURCES.md).
The list of sources is in [SOURCES.md](https://github.com/vega/vega-datasets/blob/next/SOURCES.md).

To access the data in Observable, you can import `vega-dataset`. Try our [example notebook](https://observablehq.com/@vega/vega-datasets). To access these datasets from Python, you can use the [Vega datasets python package](https://github.com/altair-viz/vega_datasets). To access them from Julia, you can use the [VegaDatasets.jl julia package](https://github.com/davidanthoff/VegaDatasets.jl).

## Versioning

We use semantic versioning. However, since this package serve datasets we have additional rules about how we version data.

We do not change data in patch releases except to resolve formatting issues. Minor releases may change the data but only update datasets in ways that do not change field names or file names. Minor releases may also add datasets. Major versions may change file names, file contents, and remove or update files.
We do not change data in patch releases except to resolve formatting issues. Minor releases may change the data but only update datasets in ways that do not change field names or file names. Minor releases may also add datasets. Major versions may change file names, file contents, and remove or update files.

## How to use it

Expand Down Expand Up @@ -60,4 +60,13 @@ console.log(cars);

## Development process

Install dependencies with `yarn`. To make a release, create a new tagged version with `yarn version` and then push the tag. The CI will automatically make a release.
Install dependencies with `yarn`.

## Release Process

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-datasets/@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-datasets/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 @@ -17,9 +17,12 @@
"url": "http://idl.cs.washington.edu"
},
"devDependencies": {
"@auto-it/conventional-commits": "^10.32.0",
"@auto-it/first-time-contributor": "^10.32.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.0.0",
"@types/d3-dsv": "^2.0.0",
"auto": "^10.32.0",
"d3-dsv": "^2.0.0",
"datalib": "^1.9.3",
"rollup": "^2.28.2",
Expand All @@ -32,6 +35,7 @@
"build": "rollup -c",
"postbuild": "terser build/vega-datasets.js -cm > build/vega-datasets.min.js",
"flights": "node scripts/flights.js",
"github": "python scripts/github.py"
"github": "python scripts/github.py",
"release": "auto shipit"
}
}
Loading