Skip to content

Commit

Permalink
chore: setup changeset and ci
Browse files Browse the repository at this point in the history
  • Loading branch information
cpsoinos committed Feb 24, 2024
1 parent 02693c0 commit 73b37cc
Show file tree
Hide file tree
Showing 6 changed files with 1,172 additions and 0 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/cli/changelog",
"commit": true,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
43 changes: 43 additions & 0 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Changesets
on:
push:
branches:
- main

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

jobs:
version:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: checkout code repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v3

- name: setup node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: pnpm ci:version
commit: 'chore: update versions'
title: 'chore: update versions'
publish: pnpm ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
76 changes: 76 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: CI
on:
pull_request:
branches:
- main

env:
CI: true

jobs:
eslint:
name: ESLint
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v3

- name: setup node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: ESLint
run: pnpm lint

prettier:
name: Prettier
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v3

- name: setup node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Prettier
run: pnpm ci:format

changeset:
name: Changeset
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }} # Needed to trigger CI when changes made

- name: Create/Update Changesets
uses: 'the-guild-org/changesets-dependencies-action@v1.2.2'
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }} # Needed to trigger CI when changes made
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@
],
"scripts": {
"build": "tsup",
"ci:publish": "changeset publish",
"ci:version": "changeset version",
"dev": "tsup --watch",
"format": "prettier --write .",
"lint": "eslint ./src/ --ext .ts",
"lint:fix": "eslint ./src/ --ext .ts --fix",
"prepare": "husky"
},
"lint-staged": {
Expand All @@ -54,6 +59,7 @@
"http2-proxy": "^5.0.53"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@cpsoinos/eslint-config-typescript": "^0.2.5",
"@cpsoinos/prettier-config": "^1.0.0",
"eslint": "^8.57.0",
Expand Down
Loading

0 comments on commit 73b37cc

Please sign in to comment.