Skip to content

Commit

Permalink
chore(workspace): setup frontmatter project (#1)
Browse files Browse the repository at this point in the history
#### What this PR does / why we need it:

As per title, project setup.
  • Loading branch information
fuxingloh authored Nov 6, 2023
1 parent c782648 commit 530cf00
Show file tree
Hide file tree
Showing 39 changed files with 4,907 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Define individuals that are responsible for code in a repository.
# More details are here: https://help.github.com/articles/about-codeowners/

/.github/ @fuxingloh
/pnpm-lock.yaml @fuxingloh
14 changes: 14 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Thanks for sending a pull request! -->

#### What this PR does / why we need it:

#### Which issue(s) will this PR fix?:

<!--
(Optional) Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->

Fixes #

#### Additional comments?:
51 changes: 51 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
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(\\(.+\\))?: .+"

- label: area/workflow
sync: true
matcher:
files: '.github/**'

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
Binary file added .github/levain-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
80 changes: 80 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
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
packages: read

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
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@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
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@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
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@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
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/oss-governance-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: OSS

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

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

jobs:
main:
name: Governance Labeler
runs-on: ubuntu-latest
steps:
- uses: fuxingloh/multi-labeler@6704db0bcba106d07482efabbc79d3092af74fa2 # v2.0.3
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@65c5fb495d1e69aa8c08a3317bc44ff8aabe9772 # v5.24.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55 changes: 55 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
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@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
script: |
const semver = context.ref.replace('refs/tags/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 Publishing
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
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_AUTH_TOKEN}" --location=global

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

- run: npm config delete "//registry.npmjs.org/:_authToken" --location=global
if: always()
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# MacOS
.DS_Store

# IntelliJ
.idea/*
!.idea/inspectionProfiles/
!.idea/dictionaries/
!.idea/codeStyles/
!.idea/modules.xml
!.idea/*.iml
!.idea/README.md

# NodeJS
node_modules
dist
build
*.tgz
coverage
.nyc_output

# turborepo
.turbo

# contented
.contented

4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
51 changes: 51 additions & 0 deletions .idea/codeStyles/Project.xml

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

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

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

12 changes: 12 additions & 0 deletions .idea/frontmatter.iml

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

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

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

Loading

0 comments on commit 530cf00

Please sign in to comment.