Skip to content
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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @shaadcode
44 changes: 26 additions & 18 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,36 @@ name: CI

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

jobs:
build:
strategy:
matrix:
node-version: [20]

name: Build with ${{ matrix.node-version }}
build-and-test:
name: Build, Lint, and Test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.8.1
- name: Use Node.js ${{ matrix.node-version }}
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm check-types
- run: pnpm build
node-version: 20
cache: "npm"

- name: Install dependencies
run: npm ci

# - name: Lint code
# run: npm run lint

# - name: Run tests
# run: npm test

- name: Build project
run: npm run build:safe

- name: Job summary
run: echo "✅ CI checks passed successfully!"
42 changes: 42 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Pre-release (beta)

on:
workflow_dispatch:
jobs:
prerelease:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write

steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: npm ci

- name: Configure git
run: |
git config --global user.email "shaadcode@gmail.com"
git config --global user.name "shaadcode"

- name: Configure npm authentication
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Run release-it for pre-release
run: npm run pre-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
55 changes: 22 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,30 @@
name: Release Package

# on:
# push:
# branches:
# - main
name: release and publish

on:
workflow_run:
workflows: ['CI']
types:
- completed

workflow_dispatch:
jobs:
build:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-22.04
environment: production
strategy:
matrix:
node-version: [20]
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.8.1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- name: Checkout source code
uses: actions/checkout@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
ref: main
fetch-depth: 0

- name: Install dependencies
run: pnpm install
run: npm ci

- name: Release
- name: initialize git user
run: |
git config --global user.email "shaadcode@gmail.com"
git config --global user.name "shaadcode"
- name: initialize the npm config
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Run release
run: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PUBLISH_NPM: 'true'
run: npx semantic-release
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ yarn-error.log*
.env

/dev/media

.npmrc
2 changes: 2 additions & 0 deletions .husky/post-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
npm run sync-main
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
#!/bin/sh
# Disable concurrent to run `check-types` after ESLint in lint-staged
cd "$(dirname "$0")/.." && npx --no lint-staged --concurrent false

pnpm build
npm run lint-staged
68 changes: 68 additions & 0 deletions .release-it.prerelease.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import type { Config } from 'release-it'

export default {
git: {
commitMessage: 'chore: release v${version}',
tagName: 'v${version}',
push: true,
},
github: {
releaseName: 'v${version}',
release: true,
preRelease: true,
},
npm: {
publish: true,
},
plugins: {
'@release-it/conventional-changelog': {
infile: 'CHANGELOG.md',
header: '# Changelog',
preset: {
name: 'conventionalcommits',
types: [
{
type: 'feat',
section: '🚀 Features',
hidden: false,
},
{
type: 'fix',
section: '🐞 Bug Fixes',
hidden: false,
},
{
type: 'chore',
section: '🧹 Chores',
hidden: false,
},
{
type: 'docs',
section: '📚 Documentation',
hidden: false,
},
{
type: 'refactor',
section: '🔧 Refactoring',
hidden: false,
},
{
type: 'perf',
section: '⚡ Performance',
hidden: false,
},
{
type: 'test',
section: '✅ Tests',
hidden: false,
},
{
type: 'style',
section: '🎨 Styles',
hidden: false,
},
],
},
},
},
} satisfies Config
70 changes: 70 additions & 0 deletions .release-it.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import type { Config } from 'release-it'

export default {
git: {
commitMessage: 'chore: release v${version}',
tagName: 'v${version}',
push: true,
},
hooks: {
'before:init': ['git pull'],
},
github: {
release: true,
releaseName: 'v${version}',
},
npm: {
publish: true,
},
plugins: {
'@release-it/conventional-changelog': {
infile: 'CHANGELOG.md',
header: '# Changelog',
preset: {
name: 'conventionalcommits',
types: [
{
type: 'feat',
section: '🚀 Features',
hidden: false,
},
{
type: 'fix',
section: '🐞 Bug Fixes',
hidden: false,
},
{
type: 'chore',
section: '🧹 Chores',
hidden: false,
},
{
type: 'docs',
section: '📚 Documentation',
hidden: false,
},
{
type: 'refactor',
section: '🔧 Refactoring',
hidden: false,
},
{
type: 'perf',
section: '⚡ Performance',
hidden: false,
},
{
type: 'test',
section: '✅ Tests',
hidden: false,
},
{
type: 'style',
section: '🎨 Styles',
hidden: false,
},
],
},
},
},
} satisfies Config
Loading