https://github.com/assemblyscript/aspublish
Minimalist publishing tool for GitHub and npm.
https://github.com/assemblyscript/aspublish
Last synced: 6 months ago
JSON representation
Minimalist publishing tool for GitHub and npm.
- Host: GitHub
- URL: https://github.com/assemblyscript/aspublish
- Owner: AssemblyScript
- License: apache-2.0
- Created: 2020-10-24T20:21:58.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2022-01-29T14:23:27.000Z (almost 4 years ago)
- Last Synced: 2025-06-24T21:44:08.003Z (6 months ago)
- Language: JavaScript
- Size: 23.4 KB
- Stars: 5
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
aspublish
=========
Minimalist publishing tool for GitHub and npm. Generates a changelog, makes a GitHub release of it, and publishes the package to npm.
Usage
-----
Set `GITHUB_TOKEN` and `NPM_TOKEN` as environment variables.
To create a release on GitHub and publish the package to npm:
```sh
npx aspublish
```
May also obtain just the next version that will be created, if necessary:
```sh
npx aspublish --version
```
The returned version is empty if no release has been triggered.
Note that npm `postversion` etc. scripts will also run normally, and that the version number in `package.json` is irrelevant (may just be `0.0.0`).
Commit format
-------------
Prefix either the commit subject or body:
Prefix | Release type | Pre 1.0.0 | Post 1.0.0
------------|--------------|--------------------|---------------
`breaking:` | Major | `0.1.0` -> `0.2.0` | `1.0.0` -> `2.0.0`
`feat:` | Minor | `0.1.0` -> `0.1.1` | `1.0.0` -> `1.1.0`
`fix:` | Patch | `0.1.0` -> `0.1.1` | `1.0.0` -> `1.0.1`
Except a few [aliases and abbreviations](./config.js), other prefixes will not trigger a new version / release.
Example
-------
As a step during GitHub Actions:
```yml
- name: Make release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
VERSION=$(npx aspublish --version)
if [ -z "$VERSION" ]; then
echo "Changes do not trigger a release"
else
echo "Publishing new version: $VERSION"
npx aspublish
fi
```
Or, if obtaining the version upfront is not necessary:
```yml
- name: Make release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx aspublish
```
See this repository's [publish.yml](.github/workflows/publish.yml) for a complete configuration (replace `node bin/aspublish.js` with `npx aspublish`).