Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add changesets-based releases #57

Merged
merged 2 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/[email protected]/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
Loading