Skip to content

Commit

Permalink
Merge pull request #24 from BitGo/migrate-to-npm-workspaces
Browse files Browse the repository at this point in the history
feat: migrate to npm workspaces
  • Loading branch information
lcovar authored Aug 9, 2024
2 parents f6b2fc4 + 477ae38 commit d6ed101
Show file tree
Hide file tree
Showing 8 changed files with 12,995 additions and 4,252 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
run: |
echo "node $(node --version)"
echo "npm $(npm --version)"
echo "yarn $(yarn --version)"
git --version
echo "base ref $GITHUB_BASE_REF"
echo "head ref $GITHUB_HEAD_REF"
Expand All @@ -53,13 +52,16 @@ jobs:
git fetch origin $GITHUB_BASE_REF
- name: Install Packages
run: yarn install --with-frozen-lockfile
run: npm ci --workspaces --include-workspace-root

- name: test
run: npx --version

- name: build packages
run: yarn lerna run build
run: npm --workspaces run build

- name: Check Source Code Formatting
run: yarn lerna exec 'prettier --check .'
run: npm run check-fmt

- name: Unit Test
run: yarn lerna run test
run: npm --workspaces test
24 changes: 14 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v3
Expand All @@ -34,24 +36,26 @@ jobs:
run: |
echo "node $(node --version)"
echo "npm $(npm --version)"
echo "yarn $(yarn --version)"
echo "rust $(rustup --version)"
git --version
- name: Configure Git & NPM
- name: Configure NPM
run: |
git config --global user.name 'Git bot'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
echo "workspaces-update = false" >> .npmrc
echo "@bitgo:registry=https://registry.npmjs.org" >> .npmrc
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc
echo "//registry.npmjs.org/:always-auth=true" >> .npmrc
- name: Install Packages
run: yarn install --with-frozen-lockfile
run: npm ci --workspaces --include-workspace-root

- name: build packages
run: yarn lerna run build
run: npm --workspaces run build

- name: Unit Test
run: npm --workspaces test

- name: Lerna Publish
run: yarn lerna publish --force-publish --include-merged-tags --conventional-commits --yes --loglevel silly --no-push --no-git-tag-version --no-changelog
- name: Release
run: npx multi-semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
7 changes: 7 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm"
]
}
4 changes: 0 additions & 4 deletions lerna.json

This file was deleted.

Loading

0 comments on commit d6ed101

Please sign in to comment.