Skip to content

Commit

Permalink
chore: Add CI/CD
Browse files Browse the repository at this point in the history
Add Github workflows for CI
Add Changesets for release management
  • Loading branch information
kevintyj committed Nov 5, 2023
1 parent 5caf860 commit 29d33af
Show file tree
Hide file tree
Showing 14 changed files with 1,027 additions and 175 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)
12 changes: 12 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "kevintyj/color" }],
"commit": false,
"title": "chore: Release ",
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
59 changes: 59 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: 🐞 Bug Report
description: File a bug/issue
title: '[fix] <title>'
labels: [bug, needs triage]
body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true
- type: textarea
attributes:
label: Current Behavior
description: A concise description of what you're experiencing.
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: A concise description of what you expected to happen.
validations:
required: true
- type: textarea
attributes:
label: Steps To Reproduce
description: Steps to reproduce the behavior.
placeholder: |
1. In this environment...
1. With this config...
1. Run '...'
1. See error...
validations:
required: false
- type: textarea
attributes:
label: Environment
description: |
examples:
- **OS**: Ubuntu 20.04
- **Node**: 13.14.0
- **npm**: 7.6.3
value: |
- OS:
- Node:
- npm:
render: markdown
validations:
required: false
- type: textarea
attributes:
label: Anything else?
description: |
Links? References? Anything that will give us more context about the issue you are encountering!
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: 🏠 Alooma Development Homebase
url: https://rvx.one/alooma-homebase
about: Access our development homebase for additional information about the repository.
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/docs_change.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 📖 Documentation Change
description: Propose changes to the documentation
title: '[docs] <title>'
labels: [documentation]
body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true
- type: textarea
attributes:
label: Describe the proposed changes
description: A concise description of what you're experiencing.
validations:
required: true
- type: textarea
attributes:
label: Anything else?
description: |
Links? References? Anything that will give us more context about the issue you are encountering!
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
60 changes: 60 additions & 0 deletions .github/ISSUE_TEMPLATE/request_feat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: 🌟 Feature Request
description: Suggest a feature idea for this project
title: '[feat] <title>'
labels: [enhancement]
body:
- type: checkboxes
attributes:
label: Is there an existing request for this?
description: Please search to see if an feature request (issue) already exists for the bug you encountered.
options:
- label: I have searched the existing feature requests
required: true
- type: textarea
attributes:
label: Is the feature request related to a problem?
description: A concise description of the issue. E.g I'm always frustrated when [...]
validations:
required: false
- type: textarea
attributes:
label: Is the feature request related to a existing bug/RFC?
description: If so, please put the PR/Issue number below.
validations:
required: false
- type: textarea
attributes:
label: Describe the solution you'd like
description: What does the feature request look like?
validations:
required: true
- type: textarea
attributes:
label: What is the definition of done?
description: What are it's subtasks? How do we know the feature request is fulfilled?
validations:
required: true
- type: textarea
attributes:
label: Any solutions considered?
description: |
Did you consider alternative solutions or features? Do you have a proposed solution for the feature request?
validations:
required: false
- type: dropdown
attributes:
label: Are you able to assist to bring the feature to reality?
options:
- No
- Yes, I can
validations:
required: true
- type: textarea
attributes:
label: Anything else?
description: |
Links? References? Anything that will give us more context about the issue you are encountering!
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## What is the purpose of this PR?

## ClickUp/Jira/Github project ticket number(s)?

## What did you do?

## How do we test it?

## Checklist before merging
- [ ] Added tests where necessary
- [ ] Performed a self-review of my code
- [ ] Ensure all acceptance criteria are met
- [ ] Implemented the UI as exactly as the design (applicable only for UI changes)
- [ ] Added comments for codes where hard-to-understand
- [ ] Haven't pushed unnecessary files (ex: `.env`, `.map`)
- [ ] Haven't ignored Typescript warnings in the code (if do so add a comment with the reason)

## Provide screenshot details of the PR

## [optional] Tests passed screenshot

## [optional] Breaking changes after PR

## Anything else?
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 🧪 CI Tests
on:
pull_request:
branches:
- '**'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 🔖Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 📦Setup PNPM
uses: pnpm/action-setup@v2
with:
version: 8
- name: 🌳Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: pnpm

- name: 🛠️Install dependencies from lockfile
run: pnpm install --frozen-lockfile

- name: 🧾Print versions
run: |
git --version
node --version
pnpm --version
pnpm commitlint --version
- name: 📝Validate PR commits with commitlint
run: pnpm commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose

- name: 🤞Run CI command
run: pnpm run ci
42 changes: 42 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: 🚀 Build & Publish
on:
push:
paths:
- '.changeset/**'
branches:
- main

# Disable concurrent builds
concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: 🔖Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 📦Setup PNPM
uses: pnpm/action-setup@v2
with:
version: 8
- name: 🌳Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: pnpm

- name: 🛠️Install dependencies from lockfile
run: pnpm install --frozen-lockfile

- name: 🦋Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: pnpm release
commit: 'ci(release): Version packages'
title: 'ci(release): Version packages'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 6 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# source files
src
tsconfig.json
.github
.changeset
.husky
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
"version": "0.0.0",
"author": "Kevin Taeyoon Jin <hello@kevintyj.com>",
"license": "BSD-3-Clause",
"private": false,
"homepage": "https://github.com/kevintyj/color#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/kevintyj/color.git"
},
"repository": "github:kevintyj/color",
"bugs": {
"url": "https://github.com/kevintyj/color/issues"
},
Expand All @@ -26,12 +24,17 @@
},
"scripts": {
"watch": "tsup --watch",
"build": "tsup",
"prepare": "husky install",
"lint:es": "eslint .",
"clean": "git clean -fdX"
"clean": "git clean -fdX",
"ci": "pnpm run lint:es && pnpm run build",
"release": "pnpm run ci && changeset publish"
},
"devDependencies": {
"@antfu/eslint-config": "^1.1.0",
"@changesets/cli": "^2.26.2",
"@changesets/changelog-github": "^0.4.8",
"@commitlint/cli": "^18.2.0",
"@commitlint/config-conventional": "^18.1.0",
"eslint": "^8.53.0",
Expand Down

0 comments on commit 29d33af

Please sign in to comment.