From b141fa104dc436a5a91fa146a5bc8c1eb4d0bacf Mon Sep 17 00:00:00 2001 From: nieyuyao Date: Wed, 10 Apr 2024 18:15:26 +0800 Subject: [PATCH] build: add release script --- .github/workflows/ci.yml | 9 ++------- .gitignore | 3 ++- README.md | 2 -- package.json | 3 ++- releash.sh | 3 +++ 5 files changed, 9 insertions(+), 11 deletions(-) create mode 100644 releash.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c9eaf2..e6d9af3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,11 +45,6 @@ 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 @@ -57,6 +52,6 @@ jobs: 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 }} diff --git a/.gitignore b/.gitignore index 9bc8152..e2896e5 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ dist node_modules *.o wasm -*.tmp \ No newline at end of file +*.tmp +.npmrc \ No newline at end of file diff --git a/README.md b/README.md index fb09eb9..3ce0e84 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -# WIP - # `webp.wasm` webp.wasm is a pure Webassembly / Javascript port of libwebp. diff --git a/package.json b/package.json index 675dd98..b1b5796 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/releash.sh b/releash.sh new file mode 100644 index 0000000..18323a1 --- /dev/null +++ b/releash.sh @@ -0,0 +1,3 @@ +echo -e "registry=https://registry.npmjs.org/\n_authToken=$NPM_AUTH_TOKEN" > .npmrc + +npm publish --tag beta