This repository has been archived by the owner on Jan 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use new
plugins
option and @semantic-release/apm
plugin
- Use `@semantic-release/apm` rather than custom code - Use new semantic-release `plugins` option - Update documentation - Remove test as the shareable config is purely static BREAKING CHANGE: require semantic-release@15.10.0 or above
- Loading branch information
Showing
8 changed files
with
34 additions
and
673 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,50 @@ | ||
# @semantic-release/apm-config | ||
|
||
[Semantic-release](https://github.com/semantic-release/semantic-release) shareable config for releasing atom packages with [apm](https://github.com/atom/apm). | ||
[**semantic-release**](https://github.com/semantic-release/semantic-release) shareable config to publish [Atom](https://www.atom.io) packages with with [apm](https://github.com/atom/apm). | ||
|
||
[![Travis](https://img.shields.io/travis/semantic-release/apm-config.svg)](https://travis-ci.org/semantic-release/apm-config) | ||
[![Codecov](https://img.shields.io/codecov/c/github/semantic-release/apm-config.svg)](https://codecov.io/gh/semantic-release/apm-config) | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/semantic-release/apm-config.svg)](https://greenkeeper.io/) | ||
|
||
[![npm latest version](https://img.shields.io/npm/v/@semantic-release/apm-config/latest.svg)](https://www.npmjs.com/package/@semantic-release/apm-config) | ||
[![npm next version](https://img.shields.io/npm/v/@semantic-release/apm-config/next.svg)](https://www.npmjs.com/package/@semantic-release/apm-config) | ||
|
||
## Usage | ||
## Plugins | ||
|
||
This shareable configuration use the following plugins: | ||
- [`@semantic-release/commit-analyzer`](https://github.com/semantic-release/commit-analyzer) | ||
- [`@semantic-release/git`](https://github.com/semantic-release/git) | ||
- [`@semantic-release/release-notes-generator`](https://github.com/semantic-release/release-notes-generator) | ||
- [`@semantic-release/npm`](https://github.com/semantic-release/npm) | ||
- [`@semantic-release/exec`](https://github.com/semantic-release/exec) | ||
- [`@semantic-release/changelog`](https://github.com/semantic-release/changelog) | ||
- [`@semantic-release/github`](https://github.com/semantic-release/github) | ||
|
||
### Local installation | ||
## Install | ||
|
||
```bash | ||
$ npm install --save-dev semantic-release @semantic-release/apm-config | ||
``` | ||
|
||
In `package.json`: | ||
## Usage | ||
|
||
The shareable config can be configured in the [**semantic-release** configuration file](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration): | ||
|
||
```json | ||
{ | ||
"release": { | ||
"extends": "@semantic-release/apm-config" | ||
} | ||
"extends": "@semantic-release/apm-config" | ||
} | ||
``` | ||
|
||
### Global installation | ||
|
||
```bash | ||
$ npm install -g semantic-release @semantic-release/apm-config | ||
$ semantic-release -e @semantic-release/apm-config | ||
``` | ||
|
||
## Configuration | ||
|
||
### Atom installation | ||
|
||
The `apm` command line has to be installed in your CI environment and available in the `PATH`. | ||
|
||
See the [Atom Package CI Scripts](https://github.com/atom/ci#atom-package-ci-scripts) documentation. | ||
|
||
_Note: If you are running multiple versions of Atom in CI (Stable + Beta), | ||
ensure that the `semantic-release` command is run on a build using the Stable | ||
channel of Atom as the Beta channel builds only provide `apm-beta`. If you are | ||
using [travis-deploy-once](https://github.com/semantic-release/travis-deploy-once) | ||
this can be achieved by setting the Stable channel build to be the last build | ||
to run, or by using the | ||
[`buildLeaderId`](https://github.com/semantic-release/travis-deploy-once#-b---buildleaderid) | ||
option._ | ||
|
||
### Atom authentication | ||
See each [plugin](#plugins) documentation for required installation and configuration steps. | ||
|
||
The Atom authentication configuration is **required** and can be set via [environment variables](#environment-variables). | ||
### Overwritten options | ||
|
||
Visit your account page on [Atom.io](https://atom.io/account) to obtain your authentication token. The token has to be made available in your CI environment via the `ATOM_ACCESS_TOKEN` environment variable. | ||
This following options are set by this shareable config: | ||
|
||
### GitHub authentication | ||
| Option | Value | | ||
|--------------------------------------------------------------|---------------------------------------------------| | ||
| [`message`](https://github.com/semantic-release/git#message) | chore(release): \${nextRelease.version} [skip ci] | | ||
|
||
The GitHub authentication configuration is **required** and can be set via [environment variables](#environment-variables). | ||
|
||
See [GitHub authentication](https://github.com/semantic-release/github#github-authentication). | ||
|
||
### Environment variables | ||
|
||
| Variable | Description | | ||
|------------------------------|----------------------------------------------------------------------| | ||
| `GH_TOKEN` or `GITHUB_TOKEN` | **Required.** The token used to authenticate with GitHub repository. | | ||
| `ATOM_ACCESS_TOKEN` | **Required.** The token used to authenticate with Atom registry. | | ||
|
||
### Additional options | ||
|
||
This shareable config uses the [`@semantic-release/git`](https://github.com/semantic-release/git), [`@semantic-release/npm`](https://github.com/semantic-release/npm), [`@semantic-release/exec`](https://github.com/semantic-release/exec), [`@semantic-release/changelog`](https://github.com/semantic-release/changelog) and [`@semantic-release/github`](https://github.com/semantic-release/github) plugins. See the documentation of each plugins for additional options. | ||
|
||
Options can be set in the Semantic-release configuration. | ||
|
||
For example to change the commit message: | ||
|
||
```json | ||
{ | ||
"release": { | ||
"extends": "@semantic-release/apm-config", | ||
"message": "chore: prepare %s release ${nextRelease.version} [skip ci]" | ||
} | ||
} | ||
``` | ||
Other options use their default values. See each [plugin](#plugins) documentation for available options. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,10 @@ | ||
const execa = require('execa'); | ||
const SemanticReleaseError = require('@semantic-release/error'); | ||
|
||
module.exports = { | ||
verifyConditions: [ | ||
async () => { | ||
if ((await execa('apm', ['-v'], {reject: false})).code !== 0) { | ||
throw new SemanticReleaseError('The apm CLI must be installed.', 'ENOAPMCLI'); | ||
} | ||
}, | ||
() => { | ||
if (!process.env.ATOM_ACCESS_TOKEN) { | ||
throw new SemanticReleaseError('The environment variable ATOM_ACCESS_TOKEN is required.', 'ENOAPMTOKEN'); | ||
} | ||
}, | ||
{path: '@semantic-release/npm', npmPublish: false}, | ||
'@semantic-release/changelog', | ||
'@semantic-release/git', | ||
plugins: [ | ||
'@semantic-release/commit-analyzer', | ||
'@semantic-release/release-notes-generator', | ||
'@semantic-release/github', | ||
], | ||
prepare: [ | ||
'@semantic-release/changelog', | ||
{path: '@semantic-release/npm', npmPublish: false}, | ||
{path: '@semantic-release/git', message: `chore(release): \${nextRelease.version} [skip ci]`}, | ||
], | ||
publish: [ | ||
{path: '@semantic-release/exec', cmd: `apm publish --tag \${nextRelease.gitTag} 1>&2`}, | ||
'@semantic-release/github', | ||
'@semantic-release/apm', | ||
['@semantic-release/git', {message: `chore(release): \${nextRelease.version} [skip ci]`}], | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.