-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Add automated release workflow #44
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 | ||
kostko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a short note about the release process in the readme would be useful: e.g. "to publish a new version of the package bump the version and push a
v<version>
tag."There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a simple release process doc, we'll improve it once we finish #12.