Skip to content

Commit

Permalink
refactor: move to lerna monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubilmax committed Sep 27, 2024
1 parent b24c564 commit e65fa4b
Show file tree
Hide file tree
Showing 80 changed files with 15,529 additions and 5,539 deletions.
15 changes: 0 additions & 15 deletions .github/actions/build-hardhat/action.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/actions/install-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
- uses: ./.github/actions/install

- name: Restore forge compilation cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: |
cache
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ runs:

steps:
- name: Install node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,8 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@v2
- uses: actions/checkout@v4
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- uses: actions/checkout@v3
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive

- uses: ./.github/actions/install
Expand Down
42 changes: 5 additions & 37 deletions .github/workflows/foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive

- uses: ./.github/actions/install
Expand All @@ -42,17 +34,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive

- uses: ./.github/actions/install-cache
Expand All @@ -63,7 +47,7 @@ jobs:
FOUNDRY_PROFILE: test

- name: Save forge compilation cache
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
path: |
cache
Expand All @@ -89,17 +73,9 @@ jobs:
max-test-rejects: 65536

steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive

- uses: ./.github/actions/install-cache
Expand Down Expand Up @@ -131,17 +107,9 @@ jobs:
max-test-rejects: 65536

steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive

- uses: ./.github/actions/install-cache
Expand Down
41 changes: 24 additions & 17 deletions .github/workflows/hardhat.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,45 @@
name: Hardhat
name: Hardhat Test Suite

on:
push:
branches:
- main
pull_request:
workflow_call:
secrets:
ALCHEMY_KEY:
required: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true

jobs:
test:
name: Test
hardhat:
runs-on: ubuntu-latest

strategy:
matrix:
package:
- @morpho-org/bundlers-sdk-ethers

steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: actions/checkout@v4

- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive
node-version: 20
cache: yarn

- name: Build contracts & package with hardhat
uses: ./.github/actions/build-hardhat
- run: yarn --immutable

- uses: actions/cache@v4
with:
path: |
packages/${{ matrix.package }}/cache/
packages/${{ matrix.package }}/artifacts/
key: ${{ github.base_ref || github.ref_name }}-${{ matrix.package }}-hardhat

- name: Run hardhat tests
run: yarn test:hardhat
- run: yarn workspace ${{ matrix.package }} test
env:
ALCHEMY_KEY: ${{ secrets.ALCHEMY_KEY }}
28 changes: 0 additions & 28 deletions .github/workflows/npm-release.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: NPM Release

on:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lerna:
runs-on: ubuntu-latest

environment:
name: npm
url: https://www.npmjs.com/package/@morpho-org/morpho-blue-bundlers

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn

- run: yarn --immutable

- run: yarn lerna version --no-private --conventional-commits --create-release github --generate-release-notes --y

- run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
yarn run publish --y
Binary file added .yarn/install-state.gz
Binary file not shown.
925 changes: 925 additions & 0 deletions .yarn/releases/yarn-4.4.0.cjs

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions .yarn/sdks/integrations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is automatically generated by @yarnpkg/sdks.
# Manual changes might be lost!

integrations:
- vscode
32 changes: 32 additions & 0 deletions .yarn/sdks/typescript/bin/tsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/bin/tsc
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;

// Defer to the real typescript/bin/tsc your application uses
module.exports = wrapWithUserWrapper(absRequire(`typescript/bin/tsc`));
32 changes: 32 additions & 0 deletions .yarn/sdks/typescript/bin/tsserver
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/bin/tsserver
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;

// Defer to the real typescript/bin/tsserver your application uses
module.exports = wrapWithUserWrapper(absRequire(`typescript/bin/tsserver`));
32 changes: 32 additions & 0 deletions .yarn/sdks/typescript/lib/tsc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/lib/tsc.js
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;

// Defer to the real typescript/lib/tsc.js your application uses
module.exports = wrapWithUserWrapper(absRequire(`typescript/lib/tsc.js`));
Loading

0 comments on commit e65fa4b

Please sign in to comment.