From b22173c9f83655c6dcd678ef378328399d3e4732 Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Tue, 30 Jan 2024 09:27:32 +0100 Subject: [PATCH] improve versioning and publishing --- .github/workflows/release.yml | 29 +++++++++++++++++++++++++++-- CONTRIBUTING.md | 10 ++++++---- package.json | 3 ++- 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4b83db7..2800ffa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: workflow_dispatch concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: - release: + version: timeout-minutes: 15 runs-on: ubuntu-latest steps: @@ -25,7 +25,32 @@ jobs: id: changesets uses: changesets/action@v1 with: - publish: pnpm publish + version: pnpm changeset-version + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + publish: + timeout-minutes: 15 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: install wasm-bindgen-cli + run: cargo install wasm-bindgen-cli + - name: install wasm-unknown-unknown target + run: rustup target add wasm32-unknown-unknown + - uses: pnpm/action-setup@v2 + with: + version: 8 + - name: install dependencies + run: pnpm install + - name: install dependencies + run: pnpm install + - name: Create Release Pull Request or Publish to npm + id: changesets + uses: changesets/action@v1 + with: + version: pnpm changeset-version + publish: pnpm changeset-publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 120dea8..b910164 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -49,10 +49,12 @@ cd examples/client-simple-webpack pnpm test:e2e ``` +## Versioning + +Is managed via Changesets. You can bump a version running the `version` action here: https://github.com/serenity-kit/opaque/actions/workflows/release.yml + ## Publish -To publish the packages (opaque and opaque-p256) you can run +Is managed via the Github CI -```sh -pnpm publish -``` +You can publish running the `publish` action here: https://github.com/serenity-kit/opaque/actions/workflows/release.yml diff --git a/package.json b/package.json index 3a8fc99..2c0b354 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,8 @@ "test:p256": "cross-env OPAQUE_BUILD=p256 jest", "test:ristretto": "jest", "test": "pnpm test:p256 && pnpm test:ristretto", - "publish": "pnpm build && pnpm changeset publish", + "changeset-version": "pnpm changeset version", + "changeset-publish": "pnpm build && pnpm changeset publish", "typecheck": "tsc --noEmit && pnpm typecheck:fullstack-simple-nextjs && pnpm typecheck:fullstack-e2e-encrypted-locker-nextjs", "typecheck:fullstack-simple-nextjs": "cd examples/fullstack-simple-nextjs && tsc --noEmit", "typecheck:fullstack-e2e-encrypted-locker-nextjs": "cd examples/fullstack-e2e-encrypted-locker-nextjs && tsc --noEmit"