-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prepare WASM bindings for release #1176
Changes from all commits
2dc3484
5600f88
3d42c9e
d9e1680
393cf57
4597ade
cc5c85a
a7bf6a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,56 @@ | ||||||||||||||||||||||||||||||||||||||
name: Release WASM Bindings | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
on: | ||||||||||||||||||||||||||||||||||||||
workflow_dispatch: | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
env: | ||||||||||||||||||||||||||||||||||||||
CARGO_TERM_COLOR: always | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
jobs: | ||||||||||||||||||||||||||||||||||||||
release: | ||||||||||||||||||||||||||||||||||||||
permissions: | ||||||||||||||||||||||||||||||||||||||
id-token: write | ||||||||||||||||||||||||||||||||||||||
runs-on: warp-ubuntu-latest-x64-16x | ||||||||||||||||||||||||||||||||||||||
Comment on lines
+10
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update permissions for NPM publishing. The current permissions block might be insufficient for NPM publishing. Consider adding necessary permissions: permissions:
id-token: write
+ contents: read
+ packages: write 📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint
|
||||||||||||||||||||||||||||||||||||||
steps: | ||||||||||||||||||||||||||||||||||||||
- name: Checkout | ||||||||||||||||||||||||||||||||||||||
uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
- name: Update rust toolchains, add target | ||||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||||
rustup update | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
- name: Cache | ||||||||||||||||||||||||||||||||||||||
uses: Swatinem/rust-cache@v2 | ||||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||||
workspaces: | | ||||||||||||||||||||||||||||||||||||||
. | ||||||||||||||||||||||||||||||||||||||
bindings_wasm | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
Comment on lines
+22
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Optimize Rust caching configuration. The current cache configuration could be more specific: - name: Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
- .
- bindings_wasm
+ bindings_wasm:target
shared-key: "wasm-bindings"
+ cache-directories: |
+ bindings_wasm/node_modules
|
||||||||||||||||||||||||||||||||||||||
- name: Setup node | ||||||||||||||||||||||||||||||||||||||
uses: actions/setup-node@v4 | ||||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||||
node-version-file: ".node-version" | ||||||||||||||||||||||||||||||||||||||
cache-dependency-path: "bindings_wasm/yarn.lock" | ||||||||||||||||||||||||||||||||||||||
cache: "yarn" | ||||||||||||||||||||||||||||||||||||||
env: | ||||||||||||||||||||||||||||||||||||||
SKIP_YARN_COREPACK_CHECK: "1" | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
Comment on lines
+29
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add NPM registry configuration for publishing. The Node.js setup should include registry configuration for publishing: - name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
cache-dependency-path: "bindings_wasm/yarn.lock"
cache: "yarn"
+ registry-url: 'https://registry.npmjs.org'
env:
SKIP_YARN_COREPACK_CHECK: "1" 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||
- name: Enable corepack | ||||||||||||||||||||||||||||||||||||||
run: corepack enable | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
- name: Install dependencies | ||||||||||||||||||||||||||||||||||||||
working-directory: bindings_wasm | ||||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||||
yarn | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
- name: Build | ||||||||||||||||||||||||||||||||||||||
working-directory: bindings_wasm | ||||||||||||||||||||||||||||||||||||||
run: yarn build | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
Comment on lines
+46
to
+49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add build validation step. Consider adding validation after the build step to ensure the output is correct: - name: Build
working-directory: bindings_wasm
run: yarn build
+
+ - name: Validate build output
+ working-directory: bindings_wasm
+ run: |
+ if [ ! -f "dist/index.js" ] || [ ! -f "dist/index.d.ts" ]; then
+ echo "Error: Build output files are missing"
+ exit 1
+ fi 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||
- name: Publish to NPM | ||||||||||||||||||||||||||||||||||||||
uses: JS-DevTools/npm-publish@v3 | ||||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||||
token: ${{ secrets.NPM_TOKEN }} | ||||||||||||||||||||||||||||||||||||||
package: bindings_wasm | ||||||||||||||||||||||||||||||||||||||
env: | ||||||||||||||||||||||||||||||||||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||
Comment on lines
+50
to
+56
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Enhance the publishing step with validation and documentation. The publishing step could be improved with additional checks and documentation: - name: Publish to NPM
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: bindings_wasm
+ dry-run: ${{ inputs.dry_run }}
+ check-version: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Create GitHub Release
+ if: ${{ !inputs.dry_run }}
+ uses: actions/create-release@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ tag_name: wasm-v${{ inputs.version }}
+ release_name: WASM Bindings v${{ inputs.version }}
+ body_path: bindings_wasm/CHANGELOG.md
+ draft: false
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,14 @@ | ||
/target | ||
/build | ||
|
||
# yarn | ||
.pnp.* | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
|
||
# build artifacts | ||
dist |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
18.19.1 | ||
20.15.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
18.19.1 | ||
20.15.0 |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
compressionLevel: mixed | ||
|
||
enableGlobalCache: false | ||
|
||
nodeLinker: node-modules | ||
|
||
yarnPath: .yarn/releases/yarn-4.5.1.cjs |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# @xmtp/wasm-bindings | ||
|
||
## 0.0.1 | ||
|
||
Initial release |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add version control parameters to the workflow trigger.
Consider adding input parameters to control the release version and ensure intentional releases:
📝 Committable suggestion