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 f9ef144
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 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
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# WIP

# `webp.wasm`
# webp.wasm

webp.wasm is a pure Webassembly / Javascript port of libwebp.

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wasm-webp",
"version": "0.0.1-beta.1",
"version": "0.0.1-beta.2",
"description": "",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down 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 release.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 f9ef144

Please sign in to comment.