Skip to content

Commit

Permalink
Merge pull request #4 from themesberg/setup-CI
Browse files Browse the repository at this point in the history
chore: add github actions for CI and release
  • Loading branch information
SutuSebastian authored Apr 19, 2024
2 parents 9047c14 + 6173752 commit 5177856
Show file tree
Hide file tree
Showing 8 changed files with 156 additions and 15 deletions.
29 changes: 29 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"prettier",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["@typescript-eslint", "react"],
settings: {
react: {
version: "detect",
},
},
rules: {
"react/display-name": "off",
},
};
24 changes: 13 additions & 11 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
Expand Down
19 changes: 19 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Setup
description: Setup Bun, Node and install packages

runs:
using: composite
steps:
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install packages
shell: bash
run: bun install
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI

on:
pull_request:
branches:
- main

jobs:
format:
name: 💅 Format
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Run format
run: bun run format:check

lint:
name: 🕵 Lint
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Run lint
run: bun run lint

typecheck:
name: ✅ Typecheck
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Run typecheck
run: bun run typecheck

build:
name: 🧰 Build
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Run build
run: bun run build
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release

on:
push:
branches:
- main

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

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Create Release Pull Request or Publish to NPM
id: changesets
uses: changesets/action@v1
with:
publish: bun run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Binary file modified bun.lockb
Binary file not shown.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@
"@svgr/cli": "8.1.0",
"@types/bun": "1.0.8",
"@types/react": "18.2.67",
"@typescript-eslint/eslint-plugin": "7.7.0",
"@typescript-eslint/parser": "7.7.0",
"clean-package": "2.2.0",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-react": "7.34.1",
"ora": "8.0.1",
"prettier": "3.2.5",
"prettier-plugin-packagejson": "2.4.12",
Expand Down

0 comments on commit 5177856

Please sign in to comment.