update ethWallet #61
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
on: | |
push: | |
branches: [main] | |
pull_request: | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 16 | |
- run: yarn | |
- run: yarn lint:check | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 16 | |
- run: yarn | |
- run: yarn test:coverage | |
- name: Comment Test Coverage | |
uses: raulanatol/jest-coverage-comment-action@main | |
with: | |
github-token: ${{ secrets.NODE_AUTH_TOKEN }} | |
use-existing-reports: true | |
host-docs: | |
if: github.ref == 'refs/heads/main' | |
needs: [lint, test] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 16 | |
- run: yarn | |
- run: yarn doc:build | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: docs | |
path: docs/ | |
- uses: crazy-max/ghaction-github-pages@v2 | |
with: | |
build_dir: docs | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish-npm-registry: | |
if: github.ref == 'refs/heads/main' | |
needs: [lint, test] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
registry-url: 'https://registry.npmjs.org' | |
- run: yarn | |
- run: yarn build | |
- run: yarn publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
publish-github-registry: | |
if: github.ref == 'refs/heads/main' | |
needs: [lint, test] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
registry-url: 'https://npm.pkg.github.com' | |
scope: '@leapwallet' | |
- run: yarn | |
- run: yarn build | |
- run: yarn publish --non-interactive | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
github-release: | |
if: github.ref == 'refs/heads/main' | |
needs: host-docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: docs | |
path: docs/ | |
- run: zip -r docs.zip docs/ | |
- name: Set $VERSION | |
run: echo "VERSION=$(yarn env | grep npm_package_version | grep -Eo '[0-9.]*')" >> $GITHUB_ENV | |
- name: Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release create v$VERSION docs.zip \ | |
-t v$VERSION \ | |
-n "[Changelog](https://github.com/leapwallet/leap-keychain/blob/v$VERSION/CHANGELOG.md)" \ | |
$([[ $VERSION = 0* ]] && echo '-p') |