Merge pull request #59 from AvaliaSystems/fb-test #90
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
name: Release | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18] | |
env: | |
CI: true | |
NODE_OPTIONS: --max-old-space-size=4096 | |
steps: | |
- run: echo "event name is:" ${{ github.event_name }} | |
- run: echo "event type is:" ${{ github.event.action }} | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: yarn | |
cache-dependency-path: '**/yarn.lock' | |
- name: Restore node_modules for lerna (key?) | |
uses: actions/cache@v3 | |
with: | |
path: '**/node_modules' | |
key: lerna-${{ matrix.node-version }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies with yarn | |
working-directory: dx-hub | |
run: yarn install --frozen-lockfile | |
- name: Build type declarations | |
working-directory: dx-hub | |
run: yarn tsc | |
- name: Build packages | |
working-directory: dx-hub | |
run: yarn build:all | |
- name: Test | |
working-directory: dx-hub | |
run: yarn test:all | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
if: ${{ github.event_name == 'push' }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: yarn | |
cache-dependency-path: '**/yarn.lock' | |
- name: Restore node_modules for lerna (key?) | |
uses: actions/cache@v3 | |
with: | |
path: '**/node_modules' | |
key: lerna-18-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies with yarn | |
working-directory: dx-hub | |
run: yarn install --frozen-lockfile | |
- name: Build type declarations | |
working-directory: dx-hub | |
run: yarn tsc | |
- name: Build packages | |
working-directory: dx-hub | |
run: yarn build:all | |
- name: Create Release Pull Request or Publish to npm | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
cwd: dx-hub | |
publish: yarn release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |