Skip to content

Release

Release #293

Workflow file for this run

name: Release
on:
workflow_dispatch:
workflow_run:
workflows: ["Run Tests"]
branches: [main, canary]
types:
- completed
jobs:
release:
name: Release
runs-on: ubuntu-20.04
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Setup Git User
run: |
git config --global user.name 'EB CI'
git config --global user.email 'ci@echobind.com'
- name: Find yarn cache location
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: JS package cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install packages
run: yarn && yarn lerna bootstrap
- name: Release Canary
if: github.event.workflow_run.head_branch == 'canary'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn publish:canary
- name: Release Latest
if: github.event.workflow_run.head_branch == 'main'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn publish:latest