Skip to content

Commit

Permalink
publish flow fixes (#28050)
Browse files Browse the repository at this point in the history
* Publish native packages publicly

* Remove unnecessary await

* Use --no-git-reset lerna option

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
padmaia and kodiakhq[bot] committed Aug 13, 2021
1 parent b11bd49 commit 367117e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions scripts/publish-native.js
Expand Up @@ -15,7 +15,7 @@ const cwd = process.cwd()

// Copy binaries to package folders, update version, and publish
let nativePackagesDir = path.join(cwd, 'packages/next/build/swc/npm')
let platforms = await (await readdir(nativePackagesDir)).filter(
let platforms = await readdir(nativePackagesDir).filter(
(name) => name !== '.gitignore'
)
for (let platform of platforms) {
Expand All @@ -33,9 +33,10 @@ const cwd = process.cwd()
JSON.stringify(pkg, null, 2)
)
execSync(
`npm publish ${path.join(nativePackagesDir, platform)}${
gitref.includes('canary') ? ' --tag canary' : ''
}`
`npm publish ${path.join(
nativePackagesDir,
platform
)} --access public ${gitref.includes('canary') ? ' --tag canary' : ''}`
)
// lerna publish in next step will fail if git status is not clean
execSync(
Expand Down
4 changes: 2 additions & 2 deletions scripts/publish-release.sh
Expand Up @@ -15,7 +15,7 @@ fi
if [[ $(git describe --exact-match 2> /dev/null || :) =~ -canary ]];
then
echo "Publishing canary"
yarn run lerna publish from-git --npm-tag canary --yes
yarn run lerna publish from-git --npm-tag canary --no-git-reset --yes

# Make sure to exit script with code 1 if publish failed
if [[ ! $? -eq 0 ]];then
Expand All @@ -27,7 +27,7 @@ fi

if [[ ! $(git describe --exact-match 2> /dev/null || :) =~ -canary ]];then
echo "Publishing stable"
yarn run lerna publish from-git --yes
yarn run lerna publish from-git --no-git-reset --yes

# Make sure to exit script with code 1 if publish failed
if [[ ! $? -eq 0 ]];then
Expand Down

0 comments on commit 367117e

Please sign in to comment.