Skip to content

Commit

Permalink
ci(publish): move to lerna
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubilmax committed Oct 17, 2024
1 parent 242d209 commit 17f8230
Show file tree
Hide file tree
Showing 4 changed files with 2,691 additions and 118 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,19 @@ jobs:

- run: pnpm install

- run: pnpm -r --parallel --no-reporter-hide-prefix -c exec "jq '.release = input.release' package.json ../../package.json > tmp.json && mv tmp.json package.json"
# - run: pnpm -r --parallel -c exec "jq '.release = input.release' package.json ../../package.json > tmp.json && mv tmp.json package.json"

- run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
# - run: pnpm -r --parallel --no-reporter-hide-prefix exec semantic-release

pnpm -r --parallel --no-reporter-hide-prefix exec semantic-release
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- if: github.ref == 'refs/heads/main'
run: pnpm lerna publish --no-private --conventional-commits --no-changelog --create-release github --yes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- if: github.ref == 'refs/heads/next'
run: pnpm lerna publish --dist-tag next --exact --no-private --no-push --conventional-commits --conventional-prerelease --no-changelog --create-release github --yes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

5 changes: 5 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "independent",
"npmClient": "pnpm"
}
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"dotenv-cli": "^7.4.2",
"happy-dom": "^15.7.4",
"husky": "^9.1.6",
"lerna": "^8.1.8",
"lint-staged": "^15.2.10",
"semantic-release": "^24.1.2",
"semantic-release-monorepo": "^8.0.2",
Expand All @@ -40,7 +41,13 @@
"extends": ["@commitlint/config-conventional"]
},
"release": {
"branches": ["main", { "name": "next", "prerelease": true }],
"branches": [
"main",
{
"name": "next",
"prerelease": true
}
],
"extends": "semantic-release-monorepo",
"plugins": [
"@semantic-release/commit-analyzer",
Expand All @@ -54,5 +61,6 @@
],
"@semantic-release/github"
]
}
},
"dependencies": {}
}
Loading

0 comments on commit 17f8230

Please sign in to comment.