Skip to content

Merge pull request #5927 from Agoric/ta/lerna-v5 #1515

Merge pull request #5927 from Agoric/ta/lerna-v5

Merge pull request #5927 from Agoric/ta/lerna-v5 #1515

Workflow file for this run

# Run after merge to trunk
# Note that this relies on branch protection having:
# Require branches to be up to date before merging
on:
push:
branches:
# $default-branch
- master
- release-pismo
jobs:
build:
if: ${{ github.repository_owner == 'agoric' }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['16.x', '18.x']
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: ./.github/actions/restore-node
with:
node-version: ${{ matrix.node-version}}
- name: notify on failure
if: failure()
uses: ./.github/actions/notify-status
with:
from: ${{ secrets.NOTIFY_EMAIL_FROM }}
to: ${{ secrets.NOTIFY_EMAIL_TO }}
password: ${{ secrets.NOTIFY_EMAIL_PASSWORD }}
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
dev-canary:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
# note: only use one node-version
node-version: ['18.x']
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/restore-node
with:
node-version: ${{ matrix.node-version }}
# Adapted from https://johnny.sh/notes/publish-canary-lerna-cicd/
- name: configure NPM token
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: check credentials
run: npm whoami
- name: publish to NPM tag
run: |
if [ "${{ github.ref_name }}" = "release-pismo" ]; then
# A pismo dev release.
TAG=pismo-dev
else
# Just a dev release.
TAG=dev
fi
yarn lerna publish --conventional-prerelease --canary --exact \
--dist-tag=$TAG --preid=$TAG-$(git rev-parse --short=7 HEAD) \
--no-push --no-verify-access --yes
- name: notify on failure
if: failure()
uses: ./.github/actions/notify-status
with:
from: ${{ secrets.NOTIFY_EMAIL_FROM }}
to: ${{ secrets.NOTIFY_EMAIL_TO }}
password: ${{ secrets.NOTIFY_EMAIL_PASSWORD }}
coverage:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
# note: only use one node-version
node-version: ['18.x']
if: ${{github.event_name == 'push' }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/restore-node
with:
node-version: ${{ matrix.node-version }}
- name: generate coverage for all tests
run: 'yarn test:c8-all || :'
- name: generate coverage/html reports
run: mkdir -p coverage/tmp && yarn c8 report --reporter=html-spa --reports-dir=coverage/html --temp-directory=coverage/tmp
- uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage
- name: Find Netlify site ID
run: |
echo "NETLIFY_SITE_ID=$(cat COVERAGE_NETLIFY_SITE_ID)" >> $GITHUB_ENV
- uses: nwtgck/[email protected]
with:
# Production deployment if a push or merged PR.
production-deploy: ${{github.event_name == 'push'}}
publish-dir: coverage/html
# SECURITY: we don't want to hand out the Github token to this action.
# github-token: ${{ secrets.GITHUB_TOKEN }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
- name: notify on failure
if: failure()
uses: ./.github/actions/notify-status
with:
from: ${{ secrets.NOTIFY_EMAIL_FROM }}
to: ${{ secrets.NOTIFY_EMAIL_TO }}
password: ${{ secrets.NOTIFY_EMAIL_PASSWORD }}
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
benchmark:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
# note: only use one node-version
node-version: ['18.x']
if: ${{github.event_name == 'push'}}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/restore-node
with:
node-version: ${{ matrix.node-version }}
- name: benchmark changes
env:
AUTOBENCH_METRICS_URL: ${{ secrets.AUTOBENCH_METRICS_URL }}
run: cd packages/swingset-runner && yarn ci:autobench
- uses: actions/upload-artifact@v3
with:
name: benchmarkstats.json
path: packages/swingset-runner/benchstats*.json
- name: notify on failure
if: failure()
uses: ./.github/actions/notify-status
with:
from: ${{ secrets.NOTIFY_EMAIL_FROM }}
to: ${{ secrets.NOTIFY_EMAIL_TO }}
password: ${{ secrets.NOTIFY_EMAIL_PASSWORD }}
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}