release v0.6.8 #36
Workflow file for this run
This file contains hidden or 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
name: Publish NPM package | |
on: | |
push: | |
tags: | |
- v* | |
# we will deploy contracts to staging on local first, then git push a tag to trigger this workflow | |
# so the "Deploy contract" task actually won't change anything | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
# fix SSH error: git@github.com: Permission denied (publickey). | |
# copy from https://github.com/actions/setup-node/issues/214#issuecomment-810829250 | |
- name: Reconfigure git to use HTTP authentication | |
run: > | |
git config --global url."https://github.com/".insteadOf | |
ssh://git@github.com/ | |
- name: Get npm cache directory | |
id: npm-cache | |
run: | | |
echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
${{ steps.npm-cache.outputs.dir }} | |
**/node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16.x | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install contract dependencies | |
run: npm ci | |
env: | |
CI: true | |
- name: Build contract package | |
run: npm run build | |
env: | |
CI: true | |
- name: Publish npm package | |
run: | | |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN} | |
npm publish --access public | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Discord notification | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELEASE_WEBHOOK }} | |
uses: Ilshidur/action-discord@master | |
with: | |
args: "npm package @perp/perp-oracle-contract ${{github.ref}} released" |