From e8baf0389d85d857d6d9bf34771f2f42327a9e94 Mon Sep 17 00:00:00 2001 From: Muhammad Azeez Date: Tue, 10 Oct 2023 16:04:14 +0300 Subject: [PATCH 1/5] 0.0.1-rc1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f5e0534..9a8b248 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@extism/extism", - "version": "1.0.0-rc1", + "version": "0.0.1-rc1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@extism/extism", - "version": "1.0.0-rc1", + "version": "0.0.1-rc1", "license": "BSD-3-Clause", "dependencies": { "@bjorn3/browser_wasi_shim": "^0.2.14", diff --git a/package.json b/package.json index 16946f3..0aafbf9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@extism/extism", - "version": "1.0.0-rc1", + "version": "0.0.1-rc1", "description": "Extism runtime for JavaScript", "scripts": { "build": "node build.js && tsc --emitDeclarationOnly --project ./tsconfig.node.json --declaration --outDir dist && tsc --emitDeclarationOnly --project ./tsconfig.browser.json --declaration --outDir dist", From ad047aaba896689fd64f94e0ce9ee3fcea4e9c57 Mon Sep 17 00:00:00 2001 From: Muhammad Azeez Date: Tue, 10 Oct 2023 16:07:24 +0300 Subject: [PATCH 2/5] create an action for publishing to npm on git tag --- .github/workflows/release.yml | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..91720af --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: Publish package to NPM + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + rust: + - stable + + steps: + - uses: actions/checkout@v3 + + - name: Setup Node.js environment + uses: actions/setup-node@v3.8.1 + + - name: Setup Deno + uses: denoland/setup-deno@v1.1.2 + + - name: NPM install with caching + run: npm install + + - name: Build + run: npm run build + + - name: Node Test + run: npm run test + + - name: Deno Test + run: deno test -A ./tests/mod.test.ts + + - name: Update package version + run: | + TAG=$(git describe --tags --abbrev=0) + echo "Latest Git tag: $TAG" + npm version $TAG --no-git-tag-version --no-commit-hooks + + - name: NPM Publish + uses: JS-DevTools/npm-publish@v2.2.2 + with: + token: ${{ secrets.NPM_TOKEN }} \ No newline at end of file From 840bae09c41f8b0588df228001faa43acb1aa428 Mon Sep 17 00:00:00 2001 From: Muhammad Azeez Date: Tue, 10 Oct 2023 16:11:17 +0300 Subject: [PATCH 3/5] revert package version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9a8b248..f5e0534 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@extism/extism", - "version": "0.0.1-rc1", + "version": "1.0.0-rc1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@extism/extism", - "version": "0.0.1-rc1", + "version": "1.0.0-rc1", "license": "BSD-3-Clause", "dependencies": { "@bjorn3/browser_wasi_shim": "^0.2.14", diff --git a/package.json b/package.json index 0aafbf9..16946f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@extism/extism", - "version": "0.0.1-rc1", + "version": "1.0.0-rc1", "description": "Extism runtime for JavaScript", "scripts": { "build": "node build.js && tsc --emitDeclarationOnly --project ./tsconfig.node.json --declaration --outDir dist && tsc --emitDeclarationOnly --project ./tsconfig.browser.json --declaration --outDir dist", From 6d2d8775a1784ad8f91d7f99ece7b4b1ea6cc95f Mon Sep 17 00:00:00 2001 From: Muhammad Azeez Date: Wed, 11 Oct 2023 12:31:15 +0300 Subject: [PATCH 4/5] Apply suggestions from code review Co-authored-by: Chris Dickinson --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 91720af..f469eae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Publish package to NPM on: push: tags: - - '*' + - 'v*' jobs: build: @@ -24,7 +24,7 @@ jobs: uses: denoland/setup-deno@v1.1.2 - name: NPM install with caching - run: npm install + run: npm ci - name: Build run: npm run build @@ -37,8 +37,8 @@ jobs: - name: Update package version run: | - TAG=$(git describe --tags --abbrev=0) - echo "Latest Git tag: $TAG" + tag="${{ github.ref }}" + tag="${tag/refs\/tags\/v/}" npm version $TAG --no-git-tag-version --no-commit-hooks - name: NPM Publish From e3636d21bbf412dfe89e4a07ddc047afe16caa82 Mon Sep 17 00:00:00 2001 From: Muhammad Azeez Date: Wed, 11 Oct 2023 12:33:49 +0300 Subject: [PATCH 5/5] use npm ci in ci.yml too --- .github/workflows/ci.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c41e9d5..9250b4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,8 +25,8 @@ jobs: - name: Setup Deno uses: denoland/setup-deno@v1.1.2 - - name: NPM install with caching - run: npm install + - name: NPM install + run: npm ci - name: Build run: npm run build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f469eae..b32b932 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: - name: Setup Deno uses: denoland/setup-deno@v1.1.2 - - name: NPM install with caching + - name: NPM install run: npm ci - name: Build @@ -39,7 +39,7 @@ jobs: run: | tag="${{ github.ref }}" tag="${tag/refs\/tags\/v/}" - npm version $TAG --no-git-tag-version --no-commit-hooks + npm version $tag --no-git-tag-version --no-commit-hooks - name: NPM Publish uses: JS-DevTools/npm-publish@v2.2.2