Skip to content

Commit

Permalink
ci: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Baran authored and Baran committed Oct 7, 2024
1 parent f6951c9 commit 7f2d45a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- uses: changesets/action@v1
id: changesets
with:
publish: pnpm run publish
publish: node scripts/release.mjs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
"main": "index.js",
"scripts": {
"build": "cross-env NX_DAEMON=false nx run-many -t build --exclude @examples/* @e2e/* --parallel=10",
"publish": "cross-env NX_DAEMON=false nx run-many -t publish --exclude @examples/* @e2e/* --parallel=10",
"prepublishOnly": "pnpm run build",
"change": "changeset"
},
"author": "",
Expand Down
2 changes: 1 addition & 1 deletion packages/arguments-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dev": "modern build -w",
"build": "modern build",
"test": "jest",
"publish": "npm publish --access public"
"prepublishOnly": "npm run build"
},
"dependencies": {
"commander": "^12.1.0",
Expand Down
18 changes: 18 additions & 0 deletions scripts/release.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { execSync } from 'node:child_process';

const pkgs = JSON.parse(execSync('pnpm recursive list --depth 0 --json').toString());

for (const pkg of pkgs) {
if (pkg.private) continue;

/**
* @type {string[]}
*/
const versions = JSON.parse(execSync(`pnpm info ${pkg.name} versions --json`).toString());
if (versions.includes(pkg.version)) continue;

execSync(`NPM_TOKEN=${process.env.NPM_TOKEN} npm publish`, {
cwd: pkg.path,
stdio: 'inherit',
});
}

0 comments on commit 7f2d45a

Please sign in to comment.