mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-11 03:13:12 +00:00
fix(ci): publish dev releases with public access for scoped package (#1715)
This commit is contained in:
1 parent
95faef5960
commit
ae1559aeb0
3 files changed
+16
-1
No files matched your search
@@ -19,6 +19,9 @@
|
|||||||
"url": "git+https://github.com/kaitranntt/ccs.git"
|
"url": "git+https://github.com/kaitranntt/ccs.git"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Tam Nhu Tran (Kai)",
|
"name": "Tam Nhu Tran (Kai)",
|
||||||
"email": "kaitranntt@users.noreply.github.com"
|
"email": "kaitranntt@users.noreply.github.com"
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ PACKAGE_NAME=$(jq -r '.name' package.json)
|
|||||||
if npm view "${PACKAGE_NAME}@${VERSION}" version >/dev/null 2>&1; then
|
if npm view "${PACKAGE_NAME}@${VERSION}" version >/dev/null 2>&1; then
|
||||||
log_info "npm already has ${PACKAGE_NAME}@${VERSION}, skipping publish"
|
log_info "npm already has ${PACKAGE_NAME}@${VERSION}, skipping publish"
|
||||||
else
|
else
|
||||||
npm publish --tag dev
|
npm publish --tag dev --access public
|
||||||
log_info "Published to npm with @dev tag"
|
log_info "Published to npm with @dev tag"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -60,4 +60,16 @@ describe('dev release workflow', () => {
|
|||||||
expect(script).toContain('git commit -m "chore(release): ${VERSION}"');
|
expect(script).toContain('git commit -m "chore(release): ${VERSION}"');
|
||||||
expect(script).not.toContain('git commit -m "chore(release): ${VERSION} [skip ci]"');
|
expect(script).not.toContain('git commit -m "chore(release): ${VERSION} [skip ci]"');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('publishes dev releases with explicit public access for scoped package', () => {
|
||||||
|
const packageJsonPath = resolvePath('../../../../package.json');
|
||||||
|
const scriptPath = resolvePath('../../../../scripts/dev-release.sh');
|
||||||
|
|
||||||
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
||||||
|
const script = fs.readFileSync(scriptPath, 'utf8');
|
||||||
|
|
||||||
|
expect(packageJson.name).toBe('@kaitranntt/ccs');
|
||||||
|
expect(packageJson.publishConfig).toEqual({ access: 'public' });
|
||||||
|
expect(script).toContain('npm publish --tag dev --access public');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user