From 4196e30164da1f8d410c396c6e5b07cbd171e242 Mon Sep 17 00:00:00 2001 From: Micha de Vries Date: Fri, 4 Oct 2024 13:25:46 +0200 Subject: [PATCH] Fix publish, bump 1.0.1 (#110) --- .github/workflows/publish.yml | 119 ++++++++++++++++------------------ package.json | 2 +- 2 files changed, 57 insertions(+), 64 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 036c51c..1d05b8e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,67 +1,60 @@ name: Publish Package to npmjs on: - push: - tags: - - "*" + push: + tags: + - "*" jobs: - build: - name: Publish - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 20 - registry-url: "https://registry.npmjs.org" - - - name: Install pnpm - uses: pnpm/action-setup@v2 - with: - version: 9 - - - name: Install Rust toolchain - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - toolchain: 1.80.1 - - - name: Install wasm-pack - run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - - name: Extract versions - run: | - echo "GIT_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV - echo "PKG_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV - - - name: Assert package versions - run: | - echo "CM_VERSION=$CM_VERSION" - echo "PKG_VERSION=$PKG_VERSION" - - if [[ "v$PKG_VERSION" != "$GIT_TAG" ]]; then - echo "Version mismatch! Please correct package versions" - exit 1 - else - echo "Version check complete" - fi - - - name: Install NPM dependencies - run: pnpm install - - - name: Build & Bundle - run: pnpm build - - - name: Publish (latest) - if: github.ref == 'refs/heads/main' - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Publish (next) - if: github.ref != 'refs/heads/main' - run: npm publish --access public --tag next - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + build: + name: Publish + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: 20 + registry-url: "https://registry.npmjs.org" + + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 9 + + - name: Install Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: 1.80.1 + + - name: Install wasm-pack + run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + + - name: Extract versions + run: | + echo "GIT_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV + echo "PKG_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV + + - name: Assert package versions + run: | + echo "CM_VERSION=$CM_VERSION" + echo "PKG_VERSION=$PKG_VERSION" + + if [[ "v$PKG_VERSION" != "$GIT_TAG" ]]; then + echo "Version mismatch! Please correct package versions" + exit 1 + else + echo "Version check complete" + fi + + - name: Install NPM dependencies + run: pnpm install + + - name: Build & Bundle + run: pnpm build + + - name: Publish + run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index db5073b..f88dc5e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@surrealdb/wasm", - "version": "1.0.0", + "version": "1.0.1", "description": "WebAssembly driver for SurrealDB", "repository": { "type": "git",