Skip to content

Update README.md

Update README.md #86

name: Publish Canary Release
on:
push:
jobs:
publish-canary:
name: Publish Canary
runs-on: ubuntu-latest
if: github.repository == 'sikanhe/gqtx'
steps:
- uses: actions/checkout@v2
- name: Cache node_modules
id: cache-modules
uses: actions/cache@v1
with:
path: node_modules
key: 14.x-${{ runner.OS }}-build-${{ hashFiles('yarn.lock') }}
- uses: actions/setup-node@v2
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
if: steps.cache-modules.outputs.cache-hit != 'true'
run: yarn
- name: Build
run: yarn build
- name: Configure Git Credentials
run: |
git config --global user.email "github-action@users.noreply.github.com"
git config --global user.name "Github Action"
- name: Publish
id: publish-step
run: |
cd dist
yarn version --no-git-tag-version --prerelease --preid ${GITHUB_SHA::8}
yarn publish --tag canary
PACKAGE_VERSION=$(node -e "console.log(require('./package.json').version)")
echo "::set-output name=PACKAGE_VERSION::$PACKAGE_VERSION"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create commit comment
uses: peter-evans/commit-comment@v1
with:
body: |
The changes have been published to npm.
```bash
yarn add -E gqtx@${{ steps.publish-step.outputs.PACKAGE_VERSION }}
```