Skip to content

Commit

Permalink
pkgname:wasm-git-browser
Browse files Browse the repository at this point in the history
  • Loading branch information
leokun authored and leokun committed Nov 2, 2024
1 parent 99102ce commit 781a311
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 105 deletions.
61 changes: 0 additions & 61 deletions .github/workflows/main.yml

This file was deleted.

24 changes: 3 additions & 21 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ jobs:
registry-url: 'https://registry.npmjs.org'
- name: Default
run: |
npm install
npx playwright install-deps
npx playwright install
sh setup.sh
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
Expand All @@ -27,30 +24,15 @@ jobs:
cd ..
source ./emsdk/emsdk_env.sh
cd emscriptenbuild
./build.sh Release
./build.sh Release-async
cd ..
set -e
npm run test
export VERSION=`npm view wasm-git dist-tags.latest`
export VERSION=`npm view wasm-git-browser dist-tags.latest`
export NEWVERSION=`node -p "require('./package.json').version"`
echo $VERSION $NEWVERSION
./preparepublishnpm.sh
PACKAGEFILE=`npm pack | tail -n 1`
tar -xvzf $PACKAGEFILE
echo "run browser tests with npm package"
rm test-browser/lg2.*
cp package/lg2.* test-browser/
npm run test-browser
rm test-browser-async/lg2_async.*
cp package/lg2_async.* test-browser-async/
npm run test-browser-async
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
if [[ "$VERSION" = "$NEWVERSION" || "$BRANCH" != "master" ]]; then
echo "version change is $VERSION->$NEWVERSION, branch is $BRANCH, not publishing, only dry-run"
npm publish --dry-run
else
npm publish
fi
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
23 changes: 4 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "wasm-git",
"name": "wasm-git-browser",
"version": "0.0.13",
"main": "lg2_async.js",
"type": "module",
"author": {
"name": "Peter Salomonsen",
Expand All @@ -10,24 +11,8 @@
"url": "https://github.com/petersalomonsen/wasm-git"
},
"files": [
"lg2.js",
"lg2.wasm",
"lg2_async.js",
"lg2_async.wasm",
"README.md"
],
"scripts": {
"test": "mocha test/**/*.spec.js",
"test-browser": "wtr test-browser/**/*.spec.js",
"test-browser-watch": "wtr test-browser/**/*.spec.js --watch",
"test-browser-async": "wtr test-browser-async/**/*.spec.js",
"patch-version": "npm --no-git-tag-version version patch"
},
"devDependencies": {
"@web/test-runner": "^0.18.2",
"@web/test-runner-playwright": "^0.11.0",
"cgi": "^0.3.1",
"chai": "^4.3.7",
"mocha": "^10.2.0"
}
}
]
}
5 changes: 1 addition & 4 deletions preparepublishnpm.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#!/bin/bash
set -e
echo "copy lg2.wasm and lg2.js from build folder"
cp emscriptenbuild/libgit2/examples/lg2.wasm .
cp emscriptenbuild/libgit2/examples/lg2.js .
cp emscriptenbuild/libgit2/examples/lg2_async.wasm .
cp emscriptenbuild/libgit2/examples/lg2_async.js .
echo "publish --dry-run (run npm publish to finalize)"
npm publish --dry-run
npm publish --dry-run

0 comments on commit 781a311

Please sign in to comment.