Skip to content
This repository was archived by the owner on Jan 20, 2023. It is now read-only.

Commit b5d20ca

Browse files
committed
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 [email protected] or above
1 parent a1e8c75 commit b5d20ca

File tree

8 files changed

+34
-673
lines changed

8 files changed

+34
-673
lines changed

.travis.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,6 @@ node_js:
44
- 10
55
- 8
66

7-
services:
8-
- docker
9-
10-
addons:
11-
apt:
12-
packages:
13-
# See https://github.com/atom/ci
14-
- libsecret-1-dev
15-
167
# Trigger a push build on master and greenkeeper branches + PRs build on every branches
178
# Avoid double build on PRs (See https://github.com/travis-ci/travis-ci/issues/1147)
189
branches:
@@ -23,19 +14,10 @@ branches:
2314
install:
2415
# Retry install on fail to avoid failing a build on network/disk/external errors
2516
- travis_retry npm install
26-
# See https://github.com/atom/ci
27-
- curl -s -O https://raw.githubusercontent.com/atom/ci/master/build-package.sh
28-
- chmod u+x build-package.sh
29-
- ./build-package.sh
30-
# Add apm to the PATH
31-
- export PATH=$PATH:~/atom/usr/bin
3217

3318
script:
3419
- npm run test
3520

36-
after_success:
37-
- npm run codecov
38-
3921
jobs:
4022
include:
4123
- stage: release

README.md

Lines changed: 23 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,50 @@
11
# @semantic-release/apm-config
22

3-
[Semantic-release](https://github.com/semantic-release/semantic-release) shareable config for releasing atom packages with [apm](https://github.com/atom/apm).
3+
[**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).
44

55
[![Travis](https://img.shields.io/travis/semantic-release/apm-config.svg)](https://travis-ci.org/semantic-release/apm-config)
6-
[![Codecov](https://img.shields.io/codecov/c/github/semantic-release/apm-config.svg)](https://codecov.io/gh/semantic-release/apm-config)
76
[![Greenkeeper badge](https://badges.greenkeeper.io/semantic-release/apm-config.svg)](https://greenkeeper.io/)
87

98
[![npm latest version](https://img.shields.io/npm/v/@semantic-release/apm-config/latest.svg)](https://www.npmjs.com/package/@semantic-release/apm-config)
109
[![npm next version](https://img.shields.io/npm/v/@semantic-release/apm-config/next.svg)](https://www.npmjs.com/package/@semantic-release/apm-config)
1110

12-
## Usage
11+
## Plugins
12+
13+
This shareable configuration use the following plugins:
14+
- [`@semantic-release/commit-analyzer`](https://github.com/semantic-release/commit-analyzer)
15+
- [`@semantic-release/git`](https://github.com/semantic-release/git)
16+
- [`@semantic-release/release-notes-generator`](https://github.com/semantic-release/release-notes-generator)
17+
- [`@semantic-release/npm`](https://github.com/semantic-release/npm)
18+
- [`@semantic-release/exec`](https://github.com/semantic-release/exec)
19+
- [`@semantic-release/changelog`](https://github.com/semantic-release/changelog)
20+
- [`@semantic-release/github`](https://github.com/semantic-release/github)
1321

14-
### Local installation
22+
## Install
1523

1624
```bash
1725
$ npm install --save-dev semantic-release @semantic-release/apm-config
1826
```
1927

20-
In `package.json`:
28+
## Usage
29+
30+
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):
2131

2232
```json
2333
{
24-
"release": {
25-
"extends": "@semantic-release/apm-config"
26-
}
34+
"extends": "@semantic-release/apm-config"
2735
}
2836
```
2937

30-
### Global installation
31-
32-
```bash
33-
$ npm install -g semantic-release @semantic-release/apm-config
34-
$ semantic-release -e @semantic-release/apm-config
35-
```
36-
3738
## Configuration
3839

39-
### Atom installation
40-
41-
The `apm` command line has to be installed in your CI environment and available in the `PATH`.
42-
43-
See the [Atom Package CI Scripts](https://github.com/atom/ci#atom-package-ci-scripts) documentation.
44-
45-
_Note: If you are running multiple versions of Atom in CI (Stable + Beta),
46-
ensure that the `semantic-release` command is run on a build using the Stable
47-
channel of Atom as the Beta channel builds only provide `apm-beta`. If you are
48-
using [travis-deploy-once](https://github.com/semantic-release/travis-deploy-once)
49-
this can be achieved by setting the Stable channel build to be the last build
50-
to run, or by using the
51-
[`buildLeaderId`](https://github.com/semantic-release/travis-deploy-once#-b---buildleaderid)
52-
option._
53-
54-
### Atom authentication
40+
See each [plugin](#plugins) documentation for required installation and configuration steps.
5541

56-
The Atom authentication configuration is **required** and can be set via [environment variables](#environment-variables).
42+
### Overwritten options
5743

58-
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.
44+
This following options are set by this shareable config:
5945

60-
### GitHub authentication
46+
| Option | Value |
47+
|--------------------------------------------------------------|---------------------------------------------------|
48+
| [`message`](https://github.com/semantic-release/git#message) | chore(release): \${nextRelease.version} [skip ci] |
6149

62-
The GitHub authentication configuration is **required** and can be set via [environment variables](#environment-variables).
63-
64-
See [GitHub authentication](https://github.com/semantic-release/github#github-authentication).
65-
66-
### Environment variables
67-
68-
| Variable | Description |
69-
|------------------------------|----------------------------------------------------------------------|
70-
| `GH_TOKEN` or `GITHUB_TOKEN` | **Required.** The token used to authenticate with GitHub repository. |
71-
| `ATOM_ACCESS_TOKEN` | **Required.** The token used to authenticate with Atom registry. |
72-
73-
### Additional options
74-
75-
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.
76-
77-
Options can be set in the Semantic-release configuration.
78-
79-
For example to change the commit message:
80-
81-
```json
82-
{
83-
"release": {
84-
"extends": "@semantic-release/apm-config",
85-
"message": "chore: prepare %s release ${nextRelease.version} [skip ci]"
86-
}
87-
}
88-
```
50+
Other options use their default values. See each [plugin](#plugins) documentation for available options.

index.js

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,10 @@
1-
const execa = require('execa');
2-
const SemanticReleaseError = require('@semantic-release/error');
3-
41
module.exports = {
5-
verifyConditions: [
6-
async () => {
7-
if ((await execa('apm', ['-v'], {reject: false})).code !== 0) {
8-
throw new SemanticReleaseError('The apm CLI must be installed.', 'ENOAPMCLI');
9-
}
10-
},
11-
() => {
12-
if (!process.env.ATOM_ACCESS_TOKEN) {
13-
throw new SemanticReleaseError('The environment variable ATOM_ACCESS_TOKEN is required.', 'ENOAPMTOKEN');
14-
}
15-
},
16-
{path: '@semantic-release/npm', npmPublish: false},
17-
'@semantic-release/changelog',
18-
'@semantic-release/git',
2+
plugins: [
3+
'@semantic-release/commit-analyzer',
4+
'@semantic-release/release-notes-generator',
195
'@semantic-release/github',
20-
],
21-
prepare: [
226
'@semantic-release/changelog',
23-
{path: '@semantic-release/npm', npmPublish: false},
24-
{path: '@semantic-release/git', message: `chore(release): \${nextRelease.version} [skip ci]`},
25-
],
26-
publish: [
27-
{path: '@semantic-release/exec', cmd: `apm publish --tag \${nextRelease.gitTag} 1>&2`},
28-
'@semantic-release/github',
7+
'@semantic-release/apm',
8+
['@semantic-release/git', {message: `chore(release): \${nextRelease.version} [skip ci]`}],
299
],
3010
};

package.json

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@semantic-release/apm-config",
3-
"description": "Semantic-release shareable config for releasing atom packages with apm",
3+
"description": "semantic-release shareable config to publish Atom packages with with apm",
44
"version": "0.0.0-development",
55
"author": "Pierre Vanduynslager (https://github.com/pvdlg)",
66
"bugs": {
@@ -16,32 +16,18 @@
1616
"Gregor Martynus (https://twitter.com/gr2m)"
1717
],
1818
"dependencies": {
19+
"@semantic-release/apm": "^1.0.0",
1920
"@semantic-release/changelog": "^3.0.0",
20-
"@semantic-release/error": "^2.1.0",
21+
"@semantic-release/commit-analyzer": "^6.1.0",
2122
"@semantic-release/exec": "^3.0.1",
2223
"@semantic-release/git": "^7.0.0",
2324
"@semantic-release/github": "^5.2.1",
24-
"@semantic-release/npm": "^5.0.1",
25-
"execa": "^1.0.0"
25+
"@semantic-release/release-notes-generator": "^7.1.4"
2626
},
2727
"devDependencies": {
28-
"ava": "^0.25.0",
29-
"codecov": "^3.0.0",
3028
"commitizen": "^3.0.0",
3129
"cz-conventional-changelog": "^2.0.0",
32-
"dockerode": "^2.5.3",
33-
"fs-extra": "^7.0.0",
34-
"get-stream": "^4.0.0",
35-
"git-log-parser": "^1.2.0",
36-
"got": "^9.0.0",
37-
"mockserver-client": "^5.3.0",
38-
"nyc": "^12.0.1",
39-
"p-retry": "^2.0.0",
4030
"semantic-release": "^15.0.0",
41-
"sinon": "^6.0.0",
42-
"strip-ansi": "^5.0.0",
43-
"tempy": "^0.2.1",
44-
"which": "^1.3.0",
4531
"xo": "^0.23.0"
4632
},
4733
"engines": {
@@ -63,19 +49,8 @@
6349
],
6450
"license": "MIT",
6551
"main": "index.js",
66-
"nyc": {
67-
"include": [
68-
"index.js"
69-
],
70-
"reporter": [
71-
"json",
72-
"text",
73-
"html"
74-
],
75-
"all": true
76-
},
7752
"peerDependencies": {
78-
"semantic-release": ">=15.9.0 <16.0.0"
53+
"semantic-release": ">=15.10.0 <16.0.0"
7954
},
8055
"prettier": {
8156
"printWidth": 120,
@@ -91,10 +66,8 @@
9166
},
9267
"scripts": {
9368
"cm": "git-cz",
94-
"codecov": "codecov -f coverage/coverage-final.json",
95-
"lint": "xo",
9669
"semantic-release": "semantic-release",
97-
"test": "nyc ava -v"
70+
"test": "xo"
9871
},
9972
"xo": {
10073
"prettier": true,

test/helpers/git-utils.js

Lines changed: 0 additions & 90 deletions
This file was deleted.

0 commit comments

Comments
 (0)