-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from oasisprotocol/kostko/feature/release
ci: Add automated release workflow
- Loading branch information
Showing
4 changed files
with
90 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# NOTE: This name appears in GitHub's Checks API and in workflow's status badge. | ||
name: release | ||
|
||
# Trigger the workflow when: | ||
on: | ||
# A push occurs to one of the matched tags. | ||
push: | ||
tags: | ||
# Pattern that roughly matches Ledger JS' version tags. | ||
# For more details on GitHub Actions' pattern match syntax, see: | ||
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#patterns-to-match-branches-and-tags. | ||
- 'v[0-9]+.[0-9]+*' | ||
|
||
jobs: | ||
|
||
prepare-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
# Check out pull request's HEAD commit instead of the merge commit to | ||
# work-around an issue where a wrong commit is being checked out. | ||
# For more details, see: | ||
# https://github.com/actions/checkout/issues/299. | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Install needed system packages | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y libusb-1.0.0 libudev-dev | ||
- name: Set up Node.js 12 | ||
uses: actions/[email protected] | ||
with: | ||
node-version: '12' | ||
registry-url: https://registry.npmjs.org | ||
|
||
- name: Build code | ||
run: | | ||
yarn install | ||
yarn build | ||
- name: Publish release on NPM | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
yarn publish \ | ||
--tag latest \ | ||
--access public |
Empty file.
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Release Process | ||
|
||
The following steps should be followed when preparing a release. | ||
|
||
## Preparing a Regular Release | ||
|
||
### Bump `package.json` Version | ||
|
||
Before a release, make sure that you have bumped the `version` field in | ||
`package.json` to the new version. | ||
|
||
### Tag Next Release | ||
|
||
Create a new signed git tag from the latest commit in origin remote's `master` | ||
branch. The tag should be called `v<VERSION>` where `VERSION` corresponds to | ||
the `version` field in `package.json`. | ||
|
||
_TODO: Add Makefile target to make this easier._ | ||
|
||
### Ensure npm Release Was Published | ||
|
||
After the tag with the next release is pushed to the [canonical git repository], | ||
the GitHub Actions [Release manager workflow] is triggered which uses the | ||
[yarn] tool to automatically build packages and publish the new release in the | ||
npm registry. | ||
|
||
Browse to [the npm registry] and make sure the new release is properly | ||
published. | ||
|
||
[canonical git repository]: https://github.com/oasisprotocol/ledger-js | ||
[Release manager workflow]: ../.github/workflows/release.yml | ||
[the npm registry]: https://www.npmjs.com/package/@oasisprotocol/ledger |
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