Skip to content

Commit

Permalink
chore: go for it
Browse files Browse the repository at this point in the history
  • Loading branch information
denolfe committed May 10, 2024
1 parent 90be023 commit 92e4997
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 25 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/release-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ jobs:
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: whoami
run: npm whoami
# - name: Canary release script
# # dry run hard-coded to true for testing and no npm token provided
# run: pnpm tsx ./scripts/publish-canary.ts
# env:
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Canary release script
# dry run hard-coded to true for testing and no npm token provided
run: pnpm tsx ./scripts/publish-canary.ts
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
24 changes: 7 additions & 17 deletions scripts/lib/getWorkspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ export const getWorkspace = async () => {
const packageDetails = await getPackageDetails(packagePublishList)
const results: PublishResult[] = []
for (const pkg of packageDetails) {
// TODO: Remove hard-coded dry-run
const res = await publishSinglePackage(pkg, { dryRun: true, tag })
const res = await publishSinglePackage(pkg, { dryRun, tag })
results.push(res)
}

Expand Down Expand Up @@ -190,25 +189,16 @@ async function publishPackageThrottled(pkg: PackageDetails, opts?: { dryRun?: bo
return npmPublishLimit(() => publishSinglePackage(pkg, { dryRun }))
}

async function publishSinglePackage(
pkg: PackageDetails,
opts: { dryRun?: boolean; tag?: 'beta' | 'canary' | 'latest' },
) {
// const { dryRun = false } = opts ?? {}
async function publishSinglePackage(pkg: PackageDetails, opts: PublishOpts) {
console.log(`🚀 ${pkg.name} publishing...`)

const { dryRun = true, tag = 'canary' } = opts
const { dryRun, tag = 'canary' } = opts

try {
const cmdArgs = [
'publish',
'-C',
pkg.packagePath,
'--no-git-checks',
'--tag',
tag,
'--dry-run', // TODO: hardcode dry-run for now
]
const cmdArgs = ['publish', '-C', pkg.packagePath, '--no-git-checks', '--tag', tag]
if (dryRun) {
cmdArgs.push('--dry-run')
}
const { exitCode, stderr } = await execa('pnpm', cmdArgs, {
cwd,
// stdio: ['ignore', 'ignore', 'pipe'],
Expand Down
2 changes: 1 addition & 1 deletion scripts/publish-canary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function main() {
const workspace = await getWorkspace()
await workspace.bumpVersion('canary')
await workspace.build()
await workspace.publishSync({ dryRun: true, tag: 'canary' })
await workspace.publishSync({ dryRun: false, tag: 'canary' })

header('🎉 Done!')
}
Expand Down

0 comments on commit 92e4997

Please sign in to comment.