Skip to content

Commit

Permalink
chore: upgrade dependencies, toolchain, and other changes (#10)
Browse files Browse the repository at this point in the history
* chore: remove rustfmt.toml as it is incorrect

* refactor: fix format

* chore: upgrade rust-toolchain

* chore: update dependencies

* chore(git): add Cargo.lock

* chore: don't force editor customization

* ci: fix

* ci: fix

* chore(typescript): regenerate index.d.ts

* refactor: prefer `map_err`

* refactor: replace `extern crate` with `use`

* test: fix failure case

* Update infinite_clone_test.mjs

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Zoltan Kochan <[email protected]>
Co-authored-by: Copilot <[email protected]>
  • Loading branch information
3 people authored Nov 22, 2024
1 parent 8416f1d commit a07534d
Show file tree
Hide file tree
Showing 11 changed files with 676 additions and 46 deletions.
28 changes: 15 additions & 13 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
build: |-
set -e &&
rustup target add x86_64-unknown-linux-gnu &&
pnpm build --target x86_64-unknown-linux-gnu &&
strip *.node
- host: ubuntu-latest
Expand All @@ -56,6 +57,7 @@ jobs:
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
build: |-
set -e &&
rustup target add aarch64-unknown-linux-gnu &&
pnpm build --target aarch64-unknown-linux-gnu &&
aarch64-unknown-linux-gnu-strip *.node
- host: ubuntu-latest
Expand All @@ -68,7 +70,10 @@ jobs:
/aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node
- host: windows-latest
target: aarch64-pc-windows-msvc
build: pnpm build --target aarch64-pc-windows-msvc
build: |-
set -e &&
rustup target add aarch64-pc-windows-msvc &&
pnpm build --target aarch64-pc-windows-msvc
name: stable - ${{ matrix.settings.target }} - node@18
runs-on: ${{ matrix.settings.host }}
steps:
Expand Down Expand Up @@ -257,7 +262,7 @@ jobs:
version: 8.10.2
run_install: false
standalone: true

- name: Install dependencies
run: |
pnpm dlx @ialdama/jsonmod --key pnpm.supportedArchitectures.libc --values musl current
Expand Down Expand Up @@ -334,7 +339,7 @@ jobs:
with:
name: bindings-aarch64-unknown-linux-musl
path: .

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
Expand Down Expand Up @@ -410,7 +415,7 @@ jobs:
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
fi
RELEASE_TYPE=$(echo $COMMIT_MESSAGE | grep -oE "\(([a-zA-Z]+)\)" | tr -d '()')
if [ "${GITHUB_REF##*/}" = "main" ]; then
if [[ $COMMIT_MESSAGE =~ ^release(\ \([a-zA-Z]+\))?:\ v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
# Use a default release type of 'latest' if no type is specified in the commit message
Expand All @@ -424,23 +429,23 @@ jobs:
if [[ $COMMIT_MESSAGE =~ ^release(\ \([a-zA-Z]+\))?:\ v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
# Use a default release type of 'canary' if no type is specified in the commit message
RELEASE_TYPE=${RELEASE_TYPE:-canary}
# Extract the current version from package.json
CURRENT_VERSION=$(jq -r '.version' package.json)
# Create a new pre-release version by appending the commit hash to the current version
NEW_VERSION="$CURRENT_VERSION-canary.$COMMIT_HASH"
# Update package.json with the new version
jq --arg newVersion "$NEW_VERSION" '.version = $newVersion' package.json > temp.json && mv temp.json package.json
echo "Updated version to $NEW_VERSION"
pnpm run version
# Set up .npmrc config file for authentication
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
# Publish the package with the new canary version
npm publish --tag $RELEASE_TYPE --access public
else
Expand All @@ -452,6 +457,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}



7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ dist
.AppleDouble
.LSOverride

# Icon must end with two
# Icon must end with two
Icon


Expand Down Expand Up @@ -184,7 +184,6 @@ $RECYCLE.BIN/
#Added by cargo

/target
Cargo.lock

.pnp.*
.yarn/*
Expand All @@ -201,4 +200,6 @@ Cargo.lock

sandbox
__reflink-tests-*
*.json.bak
*.json.bak

/.vscode/*.json
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit a07534d

Please sign in to comment.