Skip to content

Commit

Permalink
Merge pull request #57 from badrap/changesets
Browse files Browse the repository at this point in the history
Add changesets-based releases
  • Loading branch information
jviide committed Mar 20, 2024
2 parents b4366f3 + d162bb9 commit 205d3bd
Show file tree
Hide file tree
Showing 8 changed files with 3,628 additions and 152 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "badrap/valita" }],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/tidy-news-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@badrap/valita": patch
---

Add changesets-based releases
10 changes: 7 additions & 3 deletions .github/workflows/tests.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: tests
name: CI

on: [push, pull_request]
on:
push:
branches:
- "!main"
pull_request:

jobs:
build:
Expand All @@ -9,7 +13,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: npm
- run: npm ci
- run: npm run lint
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: publish
name: Publish

on:
release:
types: [created]
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
check:
Expand All @@ -17,32 +20,27 @@ jobs:
- run: npm run lint
- run: npm run typecheck
- run: npm test
publish-npm:
publish:
needs: check
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
id-token: write
pull-requests: write
issues: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
registry-url: https://registry.npmjs.org/
- run: npm publish --provenance --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
publish-jsr:
needs: check
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
node-version: 20
cache: npm
- run: npx jsr publish
version: npm run version
publish: npm run publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @badrap/valita [![tests](https://github.com/badrap/valita/workflows/tests/badge.svg)](https://github.com/badrap/valita/actions?query=workflow%3Atests) [![npm](https://img.shields.io/npm/v/@badrap/valita.svg)](https://www.npmjs.com/package/@badrap/valita)
# @badrap/valita [![ci](https://github.com/badrap/valita/workflows/ci/badge.svg)](https://github.com/badrap/valita/actions?query=workflow%3Aci) [![npm](https://img.shields.io/npm/v/@badrap/valita.svg)](https://www.npmjs.com/package/@badrap/valita)

A TypeScript library for validating & parsing structured objects. The API is _heavily_ influenced by [Zod's](https://github.com/colinhacks/zod/tree/v3) excellent API, while the implementation side aims for the impressive performance of [simple-runtypes](https://github.com/hoeck/simple-runtypes).

Expand Down

0 comments on commit 205d3bd

Please sign in to comment.