diff --git a/package.json b/package.json index 9518115a4..aea68f668 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zod", - "version": "3.21.0-canary.20230304T235951", + "version": "3.21.0", "description": "TypeScript-first schema declaration and validation library with static type inference", "main": "./lib/index.js", "types": "./index.d.ts", diff --git a/release-canary.yml b/release-canary.yml new file mode 100644 index 000000000..7018a093c --- /dev/null +++ b/release-canary.yml @@ -0,0 +1,45 @@ +# .github/release.yml + +name: Release on npm (canary) +on: + push: + branches: + - "master" + paths: + - package.json + +jobs: + build_and_publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + submodules: true + + - name: Set up Node + uses: actions/setup-node@v1 + with: + node-version: 16 + + - name: Install dependencies + run: | + yarn install + + - name: Build + run: | + yarn clean + yarn build + + - name: Set version + run: | + npm minor + npm version $(npm pkg get version | sed 's/"//g')-canary.$(date +'%Y%m%dT%H%M%S') + + - id: publish + name: Publish to NPM + uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ secrets.NPM_TOKEN }} + dry-run: true + tag: canary