Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
but not required
  • Loading branch information
fuxingloh committed Mar 18, 2024
1 parent b15e7fd commit 759fc02
Show file tree
Hide file tree
Showing 48 changed files with 6,919 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.github
.husky
.idea
**/.turbo
**/.DS_Store
**/node_modules

# tsconfig.json
packages/*/**/*.d.ts
packages/*/**/*.d.ts.map
packages/*/**/*.js
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Define individuals that are responsible for code in a repository.
# More details are here: https://help.github.com/articles/about-codeowners/

/.github/ @fuxingloh
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#### What this PR does / why we need it:

#### Which issue(s) will this PR fix?:
46 changes: 46 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version: v1

labels:
- label: kind/feature
sync: true
matcher:
title: "^feat\\(.+\\)?: .+"

- label: kind/fix
sync: true
matcher:
title: "^fix\\(.+\\)?: .+"

- label: kind/chore
sync: true
matcher:
title: "^chore\\(.+\\)?: .+"

- label: kind/refactor
sync: true
matcher:
title: "^refactor\\(.+\\)?: .+"

- label: kind/docs
sync: true
matcher:
title: "^docs\\(.+\\)?: .+"

- label: kind/dependencies
sync: true
matcher:
title: "^bump(\\(.+\\))?: .+"

checks:
- context: 'Semantic Pull Request'
description:
success: Ready for review & merge.
failure: 'Missing semantic title or label for merge [kind(directory): title]'
labels:
any:
- kind/feature
- kind/fix
- kind/chore
- kind/refactor
- kind/docs
- kind/dependencies
27 changes: 27 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: 'Features'
labels:
- 'kind/feature'
- title: 'Fixes'
labels:
- 'kind/fix'
- title: 'Chore & Maintenance'
labels:
- 'kind/refactor'
- 'kind/chore'
- 'kind/docs'
- title: 'Dependencies'
labels:
- 'kind/dependencies'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&'
version-resolver:
minor:
labels:
- 'kind/feature'
default: patch
prerelease: false
template: |
$CHANGES
20 changes: 20 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base", "helpers:pinGitHubActionDigests", ":semanticCommits", ":semanticCommitTypeAll(bump)"],
"dependencyDashboard": true,
"dependencyDashboardAutoclose": false,
"major": {
"dependencyDashboardApproval": false
},
"rangeStrategy": "bump",
"packageRules": [
{
"matchPackagePatterns": ["^@contentedjs/"],
"groupName": "@contentedjs"
},
{
"matchPackagePatterns": ["^@eslint/", "^eslint$"],
"groupName": "@eslint"
}
]
}
79 changes: 79 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: CI

on:
pull_request:
branches: [main]
merge_group:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: '.nvmrc'

- run: corepack enable pnpm

- run: pnpm install --frozen-lockfile

- run: pnpm turbo run build

test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: '.nvmrc'

- run: corepack enable pnpm

- run: pnpm install --frozen-lockfile

- run: pnpm turbo run test

lint_prettier:
name: Lint [prettier]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: '.nvmrc'

- run: corepack enable pnpm

- run: pnpm install --frozen-lockfile

- run: pnpm prettier --check .

lint_eslint:
name: Lint [eslint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: '.nvmrc'

- run: corepack enable pnpm

- run: pnpm install --frozen-lockfile

- run: pnpm turbo run lint
21 changes: 21 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: PR Labeler

on:
pull_request_target:
types: [opened, edited, synchronize]

permissions:
contents: read
issues: write
pull-requests: write
statuses: write
checks: write

jobs:
main:
name: Labeler
runs-on: ubuntu-latest
steps:
- uses: fuxingloh/multi-labeler@b15a54460c38f54043fa75f7b08a0e2aa5b94b5b # v4.0.0
with:
config-path: .github/labeler.yml
22 changes: 22 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release Drafter

on:
push:
branches: [main]

permissions:
contents: write
pull-requests: read

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true

jobs:
main:
name: Draft Release
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348 # v6.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99 changes: 99 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Release

on:
release:
types: [published]

permissions:
contents: read

jobs:
version:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.version.outputs.result }}
steps:
- id: version
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const tag = "${{ github.event.release.tag_name }}";
const semver = tag.replace('v', '');
if (semver.match(/^[0-9]+\.[0-9]+\.[0-9]+$/)) {
return semver
}
throw new Error('not semver, ref: ${context.ref}')
result-encoding: string

npm:
name: Release NPM
runs-on: ubuntu-latest
needs: version
environment: NPM Packages
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: '.nvmrc'

- run: corepack enable pnpm

- run: pnpm install --frozen-lockfile

- run: pnpm -r exec pnpm version ${{ needs.Version.outputs.result }} --git-tag-version=false

- run: pnpm turbo run build

- run: npm config set "//registry.npmjs.org/:_authToken" "\${NPM_PACKAGES_TOKEN}" --location=global

- run: pnpm -r publish --access public --tag latest --no-git-checks
env:
NPM_PACKAGES_TOKEN: ${{ secrets.NPM_PACKAGES_TOKEN }}
NPM_CONFIG_PROVENANCE: true

- run: npm config delete "//registry.npmjs.org/:_authToken" --location=global
if: always()

ghcr:
name: Release GHCR
runs-on: ubuntu-latest
needs: version
environment: GHCR Packages
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
package:
- solana-container
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: '.nvmrc'

- run: corepack enable pnpm

- run: pnpm install --frozen-lockfile

- uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
with:
platforms: linux/amd64,linux/arm64

- run: docker buildx create --use --bootstrap --driver=docker-container

- run: pnpm -r exec npm version ${{ needs.version.outputs.result }} --git-tag-version=false

- run: pnpm turbo run push:docker --filter=${{ matrix.package }} --concurrency=1
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MacOS
.DS_Store

# NodeJS
node_modules
dist
build
*.tgz
coverage
.nyc_output

# turborepo
.turbo

# contented
.contented

# tsconfig.json
packages/*/**/*.d.ts
packages/*/**/*.d.ts.map
packages/*/**/*.js
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
10 changes: 10 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 759fc02

Please sign in to comment.