Skip to content

Commit

Permalink
chore: swap lerna, almost entirely, for nx (#2902)
Browse files Browse the repository at this point in the history
* chore: swap lerna, almost entirely, for nx

* chore: remove test script
  • Loading branch information
SiTaggart committed Mar 30, 2023
1 parent 819c875 commit a27c509
Show file tree
Hide file tree
Showing 106 changed files with 2,764 additions and 2,003 deletions.
84 changes: 18 additions & 66 deletions .github/workflows/on_merge_to_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,67 +8,17 @@ on:
- main

jobs:
prerelease:
name: Prerelease test and build
version_or_publish:
name: Lint, test, build and publish or release
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Node.js 16.13
uses: actions/setup-node@v3
with:
node-version: 16.13.x

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- name: Load Yarn cache
uses: actions/cache@v3
id: yarn_cache_id
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn
- name: Node modules cache
uses: actions/cache@v3
id: node_modules_cache_id
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Install Dependencies
if: steps.yarn_cache_id.outputs.cache-hit != 'true' || steps.node_modules_cache_id.outputs.cache-hit != 'true'
run: yarn install --immutable

- name: Run prerelease
run: yarn prerelease
fetch-depth: 0

- name: Store build artifacts
uses: actions/upload-artifact@v3
with:
name: compiled-js-and-types
path: |
packages/**/dist/**/*
packages/paste-core/core-bundle/**/*
packages/paste-icons/cjs/**/*
packages/paste-icons/esm/**/*
packages/paste-design-tokens/types/**/*
packages/paste-codemods/tools/.cache/mappings.json
version_or_publish:
name: Version or publish the packages
needs: prerelease
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- uses: nrwl/nx-set-shas@v3

- name: Setup Node.js 16.13
uses: actions/setup-node@v3
Expand Down Expand Up @@ -101,11 +51,10 @@ jobs:
if: steps.yarn_cache_id.outputs.cache-hit != 'true' || steps.node_modules_cache_id.outputs.cache-hit != 'true'
run: yarn install --immutable

- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: compiled-js-and-types
path: packages/
- name: Run prerelease
run: yarn prerelease --base=origin/main
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

- name: Setup CI Git User
run: |
Expand All @@ -126,16 +75,16 @@ jobs:

chromatic:
name: Chromatic baseline update
needs: prerelease
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'chore(release): version packages')"
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
# Chromatic needs the full git history to work
fetch-depth: 0

- uses: nrwl/nx-set-shas@v3

- name: Setup Node.js 16.13
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -167,11 +116,10 @@ jobs:
if: steps.yarn_cache_id.outputs.cache-hit != 'true' || steps.node_modules_cache_id.outputs.cache-hit != 'true'
run: yarn install --immutable

- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: compiled-js-and-types
path: packages/
- name: Build packages
run: yarn build --base=origin/main~1
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

- name: Run Chromatic
uses: chromaui/action@v1
Expand Down Expand Up @@ -223,6 +171,10 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: nrwl/nx-set-shas@v3

- name: Setup Node.js 16.13
uses: actions/setup-node@v3
Expand Down

0 comments on commit a27c509

Please sign in to comment.