From a4aa6f10fbc2e727904f17c04d45ac24e33c178d Mon Sep 17 00:00:00 2001 From: Max Huang-Hobbs Date: Tue, 19 Nov 2024 17:44:15 +0000 Subject: [PATCH] don't publish src, don't forget to `napi prepublish` --- .github/workflows/publish.yml | 13 +++++++-- .npmignore | 14 +++++++++- npm/darwin-arm64/package.json | 2 +- npm/darwin-x64/package.json | 2 +- npm/linux-arm-gnueabihf/package.json | 2 +- npm/linux-arm64-gnu/package.json | 2 +- npm/linux-x64-gnu/package.json | 2 +- npm/win32-arm64-msvc/package.json | 2 +- npm/win32-x64-msvc/package.json | 2 +- package.json | 6 +++- yarn.lock | 42 ++++++++++++++++++++++++++++ 11 files changed, 77 insertions(+), 12 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6ffcbcca..ecd1a1fb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -63,13 +63,16 @@ jobs: id: check_changes run: | git remote set-url origin https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git + OLD_PACKAGE_VERSION=$(node -e "console.log(require('./package.json').version)") # Generate changes from beachball, including package.json version bump - if yarn beachball bump | grep "Removing change files:"; then - echo "changes!" + yarn beachball bump + + # check for changes + PACKAGE_VERSION=$(node -e "console.log(require('./package.json').version)") + if [ "$OLD_PACKAGE_VERSION" != "$PACKAGE_VERSION" ]; then echo "HAS_CHANGES=true" >> "$GITHUB_OUTPUT" else - echo "no changes!" echo "HAS_CHANGES=false" >> "$GITHUB_OUTPUT" fi shell: bash @@ -90,6 +93,10 @@ jobs: git tag "v$PACKAGE_VERSION" git push origin main --tags + # Required to do github releasing from napi & prep `optionalDependencies` in package.json + # for final publish + yarn prepublishOnly + # Publish all packages yarn npm publish --tag "latest" --access public --tolerate-republish env: diff --git a/.npmignore b/.npmignore index 4a0b4b12..3442ac3a 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,5 @@ target +Cargo.toml Cargo.lock .cargo .github @@ -12,4 +13,15 @@ yarn.lock __test__ renovate.json token -*.stackdump \ No newline at end of file +*.stackdump +.devcontainer +crates +rust-analyzer-target +target +scripts +lldb +.vscode +.persist +.beachballrc.json +CODEOWNERS +change diff --git a/npm/darwin-arm64/package.json b/npm/darwin-arm64/package.json index 9c20ce19..9b7f3a99 100644 --- a/npm/darwin-arm64/package.json +++ b/npm/darwin-arm64/package.json @@ -19,4 +19,4 @@ "type": "git", "url": "https://github.com/Adjective-Object/good-fences-rs-core" } -} \ No newline at end of file +} diff --git a/npm/darwin-x64/package.json b/npm/darwin-x64/package.json index e7d0d38f..65f32e84 100644 --- a/npm/darwin-x64/package.json +++ b/npm/darwin-x64/package.json @@ -19,4 +19,4 @@ "type": "git", "url": "https://github.com/Adjective-Object/good-fences-rs-core" } -} \ No newline at end of file +} diff --git a/npm/linux-arm-gnueabihf/package.json b/npm/linux-arm-gnueabihf/package.json index 350cdfde..79d96342 100644 --- a/npm/linux-arm-gnueabihf/package.json +++ b/npm/linux-arm-gnueabihf/package.json @@ -19,4 +19,4 @@ "type": "git", "url": "https://github.com/Adjective-Object/good-fences-rs-core" } -} \ No newline at end of file +} diff --git a/npm/linux-arm64-gnu/package.json b/npm/linux-arm64-gnu/package.json index 1f1cb813..ea17319d 100644 --- a/npm/linux-arm64-gnu/package.json +++ b/npm/linux-arm64-gnu/package.json @@ -22,4 +22,4 @@ "libc": [ "glibc" ] -} \ No newline at end of file +} diff --git a/npm/linux-x64-gnu/package.json b/npm/linux-x64-gnu/package.json index b8bc87d1..eb77fdef 100644 --- a/npm/linux-x64-gnu/package.json +++ b/npm/linux-x64-gnu/package.json @@ -22,4 +22,4 @@ "libc": [ "glibc" ] -} \ No newline at end of file +} diff --git a/npm/win32-arm64-msvc/package.json b/npm/win32-arm64-msvc/package.json index 5932c9fd..96ca6534 100644 --- a/npm/win32-arm64-msvc/package.json +++ b/npm/win32-arm64-msvc/package.json @@ -19,4 +19,4 @@ "type": "git", "url": "https://github.com/Adjective-Object/good-fences-rs-core" } -} \ No newline at end of file +} diff --git a/npm/win32-x64-msvc/package.json b/npm/win32-x64-msvc/package.json index a05e77d6..994d3abc 100644 --- a/npm/win32-x64-msvc/package.json +++ b/npm/win32-x64-msvc/package.json @@ -19,4 +19,4 @@ "type": "git", "url": "https://github.com/Adjective-Object/good-fences-rs-core" } -} \ No newline at end of file +} diff --git a/package.json b/package.json index d6508c08..7ef4253d 100644 --- a/package.json +++ b/package.json @@ -48,5 +48,9 @@ "dependencies": { "commander": "^9.4.1" }, + "workspaces": [ + "npm/*", + "." + ], "packageManager": "yarn@4.4.0+sha512.91d93b445d9284e7ed52931369bc89a663414e5582d00eea45c67ddc459a2582919eece27c412d6ffd1bd0793ff35399381cb229326b961798ce4f4cc60ddfdb" -} +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index ca32149f..e8283fc7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -33,6 +33,48 @@ __metadata: languageName: node linkType: hard +"@good-fences/api-darwin-arm64@workspace:npm/darwin-arm64": + version: 0.0.0-use.local + resolution: "@good-fences/api-darwin-arm64@workspace:npm/darwin-arm64" + languageName: unknown + linkType: soft + +"@good-fences/api-darwin-x64@workspace:npm/darwin-x64": + version: 0.0.0-use.local + resolution: "@good-fences/api-darwin-x64@workspace:npm/darwin-x64" + languageName: unknown + linkType: soft + +"@good-fences/api-linux-arm-gnueabihf@workspace:npm/linux-arm-gnueabihf": + version: 0.0.0-use.local + resolution: "@good-fences/api-linux-arm-gnueabihf@workspace:npm/linux-arm-gnueabihf" + languageName: unknown + linkType: soft + +"@good-fences/api-linux-arm64-gnu@workspace:npm/linux-arm64-gnu": + version: 0.0.0-use.local + resolution: "@good-fences/api-linux-arm64-gnu@workspace:npm/linux-arm64-gnu" + languageName: unknown + linkType: soft + +"@good-fences/api-linux-x64-gnu@workspace:npm/linux-x64-gnu": + version: 0.0.0-use.local + resolution: "@good-fences/api-linux-x64-gnu@workspace:npm/linux-x64-gnu" + languageName: unknown + linkType: soft + +"@good-fences/api-win32-arm64-msvc@workspace:npm/win32-arm64-msvc": + version: 0.0.0-use.local + resolution: "@good-fences/api-win32-arm64-msvc@workspace:npm/win32-arm64-msvc" + languageName: unknown + linkType: soft + +"@good-fences/api-win32-x64-msvc@workspace:npm/win32-x64-msvc": + version: 0.0.0-use.local + resolution: "@good-fences/api-win32-x64-msvc@workspace:npm/win32-x64-msvc" + languageName: unknown + linkType: soft + "@good-fences/api@workspace:.": version: 0.0.0-use.local resolution: "@good-fences/api@workspace:."