Skip to content

Commit 99b9e0a

Browse files
committed
Update README, add an example
1 parent 66a987e commit 99b9e0a

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

README.md

+33-1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,36 @@ Prefix | Release type | Pre 1.0.0 | Post 1.0.0
3838
`feat:` | Minor | `0.1.0` -> `0.1.1` | `1.0.0` -> `1.1.0`
3939
`fix:` | Patch | `0.1.0` -> `0.1.1` | `1.0.0` -> `1.0.1`
4040

41-
Everything else, except a few [abbreviations](./config.js), will not trigger a new version / release.
41+
Except a few [aliases and abbreviations](./config.js), other prefixes will not trigger a new version / release.
42+
43+
Example
44+
-------
45+
46+
As a step during GitHub Actions:
47+
48+
```yml
49+
- name: Make release
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
53+
run: |
54+
VERSION=$(npx aspublish --version)
55+
if [ -z "$VERSION" ]; then
56+
echo "Changes do not trigger a release"
57+
else
58+
echo "Publishing new version: $VERSION"
59+
npx aspublish
60+
fi
61+
```
62+
63+
Or, if obtaining the version upfront is not necessary:
64+
65+
```yml
66+
- name: Make release
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
70+
run: npx aspublish
71+
```
72+
73+
See this repository's [publish.yml](.github/workflows/publish.yml) for a complete configuration (replace `node bin/aspublish.js` with `npx aspublish`).

0 commit comments

Comments
 (0)