Unverified Commit 367117e8 authored by Maia Teegarden's avatar Maia Teegarden Committed by GitHub

publish flow fixes (#28050)

* Publish native packages publicly

* Remove unnecessary await

* Use --no-git-reset lerna option
Co-authored-by: 's avatarkodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
parent b11bd492
...@@ -15,7 +15,7 @@ const cwd = process.cwd() ...@@ -15,7 +15,7 @@ const cwd = process.cwd()
// Copy binaries to package folders, update version, and publish // Copy binaries to package folders, update version, and publish
let nativePackagesDir = path.join(cwd, 'packages/next/build/swc/npm') 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' (name) => name !== '.gitignore'
) )
for (let platform of platforms) { for (let platform of platforms) {
...@@ -33,9 +33,10 @@ const cwd = process.cwd() ...@@ -33,9 +33,10 @@ const cwd = process.cwd()
JSON.stringify(pkg, null, 2) JSON.stringify(pkg, null, 2)
) )
execSync( execSync(
`npm publish ${path.join(nativePackagesDir, platform)}${ `npm publish ${path.join(
gitref.includes('canary') ? ' --tag canary' : '' nativePackagesDir,
}` platform
)} --access public ${gitref.includes('canary') ? ' --tag canary' : ''}`
) )
// lerna publish in next step will fail if git status is not clean // lerna publish in next step will fail if git status is not clean
execSync( execSync(
......
...@@ -15,7 +15,7 @@ fi ...@@ -15,7 +15,7 @@ fi
if [[ $(git describe --exact-match 2> /dev/null || :) =~ -canary ]]; if [[ $(git describe --exact-match 2> /dev/null || :) =~ -canary ]];
then then
echo "Publishing canary" 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 # Make sure to exit script with code 1 if publish failed
if [[ ! $? -eq 0 ]];then if [[ ! $? -eq 0 ]];then
...@@ -27,7 +27,7 @@ fi ...@@ -27,7 +27,7 @@ fi
if [[ ! $(git describe --exact-match 2> /dev/null || :) =~ -canary ]];then if [[ ! $(git describe --exact-match 2> /dev/null || :) =~ -canary ]];then
echo "Publishing stable" 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 # Make sure to exit script with code 1 if publish failed
if [[ ! $? -eq 0 ]];then if [[ ! $? -eq 0 ]];then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment