Merge pull request #645 from oasisprotocol/dependabot/npm_and_yarn/je… #13
Workflow file for this run
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
# 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@v3 | |
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 14 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '14' | |
registry-url: https://registry.npmjs.org | |
- name: Build code | |
run: | | |
yarn install --frozen-lockfile | |
yarn build | |
- name: Publish release on NPM | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: | | |
yarn publish \ | |
--tag latest \ | |
--access public |