Skip to content

Commit

Permalink
ci: switch to changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
wobsoriano committed Sep 20, 2024
1 parent cbca773 commit 5884cfa
Show file tree
Hide file tree
Showing 6 changed files with 4,322 additions and 3,156 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/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
35 changes: 28 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,42 @@ name: Release

on:
push:
tags:
- 'v*'
branches:
- main

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

jobs:
release:
permissions:
contents: write # to create release (changesets/action)
pull-requests: write # to create pull request (changesets/action)
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout Repo
uses: actions/checkout@v4
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- uses: pnpm/action-setup@v4
with:
version: 9.10.0

- uses: actions/setup-node@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 20.x
cache: pnpm

- run: npx changelogithub
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: pnpm release
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
55 changes: 30 additions & 25 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,48 @@
name: Build and Test
name: CI

on: [push]
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ${{ matrix.operating-system }}

test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [16.x, 17.x]
operating-system: [ubuntu-latest]
node: [20.x]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false

steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 2

- uses: pnpm/[email protected]
fetch-depth: 0
- uses: pnpm/action-setup@v4
with:
version: 9.10.0

- name: Setup Node.js environment ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Set up Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: ${{ matrix.node }}
cache: pnpm

- name: Install dependencies
run: pnpm install
run: pnpm install --frozen-lockfile

- name: Install dependencies
run: pnpm install
- name: Lint
run: pnpm lint

- name: Typecheck
run: pnpm typecheck

- name: Build
run: pnpm run build
run: pnpm build

- name: Test
run: pnpm run test
env:
CI: true

- name: Typecheck
run: pnpm run typecheck
run: pnpm test
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "module",
"version": "0.2.2",
"private": false,
"packageManager": "pnpm@7.32.3",
"packageManager": "pnpm@9.10.0",
"description": "Primitive and flexible state management for Solid based on Jotai.",
"author": "Robert Soriano <[email protected]>",
"license": "MIT",
Expand Down Expand Up @@ -65,8 +65,8 @@
},
"devDependencies": {
"@antfu/eslint-config-ts": "^0.38.6",
"@changesets/cli": "^2.27.8",
"@solidjs/testing-library": "^0.7.0",
"bumpp": "^9.1.0",
"esbuild": "^0.17.18",
"esbuild-plugin-solid": "^0.5.0",
"eslint": "^8.40.0",
Expand Down
Loading

0 comments on commit 5884cfa

Please sign in to comment.