Skip to content

Commit

Permalink
Merge pull request #114 from ember-cli/kg-add-release-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
kategengler authored Apr 5, 2023
2 parents e1aebc3 + 1e36034 commit 851b7b4
Show file tree
Hide file tree
Showing 5 changed files with 3,411 additions and 43 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- main
tags:
- '*'
pull_request: {}

concurrency:
Expand Down Expand Up @@ -32,3 +34,28 @@ jobs:
run: yarn lint
- name: Run Tests
run: yarn test

publish:
name: Publish to npm
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install node
uses: actions/setup-node@v3
with:
node-version: 16.x
registry-url: 'https://registry.npmjs.org'

- name: install dependencies
run: yarn install --frozen-lockfile --ignore-engines

- name: auto-dist-tag
run: npx auto-dist-tag --write

- name: publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Changelog
62 changes: 62 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Release Process

Releases are mostly automated using
[release-it](https://github.com/release-it/release-it/) and
[lerna-changelog](https://github.com/lerna/lerna-changelog/).

## Preparation

Since the majority of the actual release process is automated, the primary
remaining task prior to releasing is confirming that all pull requests that
have been merged since the last release have been labeled with the appropriate
`lerna-changelog` labels and the titles have been updated to ensure they
represent something that would make sense to our users. Some great information
on why this is important can be found at
[keepachangelog.com](https://keepachangelog.com/en/1.0.0/), but the overall
guiding principle here is that changelogs are for humans, not machines.

When reviewing merged PR's the labels to be used are:

* breaking - Used when the PR is considered a breaking change.
* enhancement - Used when the PR adds a new feature or enhancement.
* bug - Used when the PR fixes a bug included in a previous release.
* documentation - Used when the PR adds or updates documentation.
* internal - Used for internal changes that still require a mention in the
changelog/release notes.

## Release

Once the prep work is completed, the actual release is straight forward:

* First, ensure that you have installed your projects dependencies:

```sh
yarn install
```

* Second, ensure that you have obtained a
[GitHub personal access token][generate-token] with the `repo` scope (no
other permissions are needed). Make sure the token is available as the
`GITHUB_AUTH` environment variable.

For instance:

```bash
export GITHUB_AUTH=abc123def456
```

[generate-token]: https://github.com/settings/tokens/new?scopes=repo&description=GITHUB_AUTH+env+variable

* And last (but not least 😁) do your release.

```sh
npx release-it
```

[release-it](https://github.com/release-it/release-it/) manages the actual
release process. It will prompt you to to choose the version number after which
you will have the chance to hand tweak the changelog to be used (for the
`CHANGELOG.md` and GitHub release), then `release-it` continues on to tagging,
pushing the tag and commits, etc.

CI will publish the tag to npm.
57 changes: 40 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,60 @@
"name": "ember-cli-preprocess-registry",
"version": "4.0.0",
"description": "Preprocessor registry used internally by ember-cli.",
"main": "index.js",
"scripts": {
"test": "mocha tests/**/*",
"lint": "mocha tests/unit/lint-test.js"
"homepage": "https://github.com/ember-cli/ember-cli-preprocessor-registry#readme",
"bugs": {
"url": "https://github.com/ember-cli/ember-cli-preprocessor-registry/issues"
},
"files": [
"index.js",
"preprocessors.js",
"lib"
],
"repository": {
"type": "git",
"url": "git+https://github.com/ember-cli/ember-cli-preprocessor-registry.git"
},
"author": "ember-cli Contributors",
"license": "MIT",
"engines": {
"node": "16.* || >= 18"
},
"bugs": {
"url": "https://github.com/ember-cli/ember-cli-preprocessor-registry/issues"
"author": "ember-cli Contributors",
"main": "index.js",
"files": [
"index.js",
"preprocessors.js",
"lib"
],
"scripts": {
"lint": "mocha tests/unit/lint-test.js",
"test": "mocha tests/**/*"
},
"homepage": "https://github.com/ember-cli/ember-cli-preprocessor-registry#readme",
"dependencies": {
"broccoli-funnel": "^3.0.8",
"debug": "^4.3.2"
},
"devDependencies": {
"@release-it-plugins/lerna-changelog": "^5.0.0",
"chai": "^4.3.4",
"eslint-plugin-chai-expect": "^2.0.1",
"mocha": "^6.2.2",
"mocha-eslint": "^5.0.0"
"mocha-eslint": "^5.0.0",
"release-it": "^15.5.0"
},
"engines": {
"node": "16.* || >= 18"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
},
"release-it": {
"plugins": {
"@release-it-plugins/lerna-changelog": {
"infile": "CHANGELOG.md",
"launchEditor": true
}
},
"git": {
"tagName": "v${version}"
},
"github": {
"release": true,
"tokenRef": "GITHUB_AUTH"
},
"npm": {
"publish": false
}
}
}
Loading

0 comments on commit 851b7b4

Please sign in to comment.