Skip to content

Commit

Permalink
build: add release script
Browse files Browse the repository at this point in the history
  • Loading branch information
nieyuyao committed Apr 10, 2024
1 parent b41cbb4 commit b141fa1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,13 @@ jobs:
- name: test
run: npm run test

- name: echo
env:
NODE_AUTH_TOKEN: ${{ vars.NPM_TOKEN }}
run: echo $NODE_AUTH_TOKEN

release:
if: ${{ startsWith(github.ref, 'refs/tags') && startsWith(github.ref_name, 'v') }}
runs-on: ubuntu-latest
needs: [build]
environment: release
steps:
- name: release
run: npm publish --tag beta
run: npm run release
env:
NODE_AUTH_TOKEN: ${{ vars.NPM_PUBLISH_TOKEN }}
NPM_AUTH_TOKEN: ${{ vars.NPM_PUBLISH_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ dist
node_modules
*.o
wasm
*.tmp
*.tmp
.npmrc
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# WIP

# `webp.wasm`

webp.wasm is a pure Webassembly / Javascript port of libwebp.
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"build-wasm:cjs": "bash ./build.sh",
"build:esm": "npm run build-wasm:esm && tsc -m ES6 --outDir ./dist/esm && cp -r src/*.d.ts dist",
"build:cjs": "npm run build-wasm:cjs && tsc -m commonjs --outDir ./dist/cjs && cp -r src/*.d.ts dist",
"test": "node --experimental-wasm-modules --experimental-vm-modules ./node_modules/jest/bin/jest.js"
"test": "node --experimental-wasm-modules --experimental-vm-modules ./node_modules/jest/bin/jest.js",
"release": "bash ./release.sh"
},
"author": "nieyuyao",
"license": "MIT",
Expand Down
3 changes: 3 additions & 0 deletions releash.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
echo -e "registry=https://registry.npmjs.org/\n_authToken=$NPM_AUTH_TOKEN" > .npmrc

npm publish --tag beta

0 comments on commit b141fa1

Please sign in to comment.