chore: 🔧 initial setup

This commit is contained in:
Guz013
2023-11-27 15:50:22 -03:00
parent f75c6b0c47
commit e3e3ba3683
24 changed files with 5664 additions and 0 deletions

49
.github/actions/pnpm-setup/action.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: PNPM Setup
inputs:
node-version:
required: false
type: number
default: 18
pnpm-version:
required: false
type: number
default: 8
install-deps:
required: false
type: boolean
default: true
runs:
using: composite
steps:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
- name: Install PNPM
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: ${{ inputs.pnpm-version }}
run_install: false
- name: Get store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys:
${{ runner.os }}-pnpm-store-
- name: Install dependencies
if: inputs.install-deps
run: pnpm install
shell: bash

51
.github/workflows/checks.yml vendored Normal file
View File

@@ -0,0 +1,51 @@
name: 🧪 Code checking
on:
push:
branches:
- dev
- main
- changeset-release/main
pull_request:
branches:
- dev
- main
- changeset-release/main
types:
- opened
- synchronize
- reopened
jobs:
linting:
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Setup environment
uses: ./.github/actions/pnpm-setup
- name: Run ESLint
run: pnpm run lint
vitest:
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Setup environment
uses: ./.github/actions/pnpm-setup
- name: Run Vitests
run: pnpm run test

23
.github/workflows/deploy-preview.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: ▲ Deploy preview
on:
push:
branches:
- dev
pull_request:
branches:
- dev
- main
- changeset-release/main
types:
- opened
- synchronize
- reopened
jobs:
deploy:
if: github.repository == 'loreddev/marknow'
uses: loreddev/.github/.github/workflows/vercel-deploy.yml@main
secrets: inherit
with:
production: false

19
.github/workflows/deploy.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
name: ▲ Deploy
on:
workflow_run:
workflows:
- 🧪 Code checking
- 🎉 Release
types:
- completed
branches:
- main
jobs:
deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.repository == 'loreddev/marknow' }}
uses: loreddev/.github/.github/workflows/vercel-deploy.yml@main
secrets: inherit
with:
production: true

15
.github/workflows/mirror.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: 🪞 Repository Mirrors
on:
push:
branches:
- main
- dev
jobs:
mirror:
if: github.repository == 'loreddev/marknow'
uses: loreddev/.github/.github/workflows/mirrors.yml@main
secrets: inherit
with:
codeberg-repo: https://codeberg.org/LoredDev/MarkNow

49
.github/workflows/release-branch.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: 🦋 Release branch
on:
push:
branches:
- dev
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
update-release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
name: Update/Create release branch
env:
HUSKY: 0
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup environment
uses: ./.github/actions/pnpm-setup
- name: Update release PR
id: changesets
uses: loreddev/changeset-action@main
with:
branch: main
commit: 'ci: 👷🦋 version packages'
title: 🦋 Release branch
publish: pnpm run release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update dev branch
if: steps.changesets.outputs.hasChangesets == 'false'
uses: devmasx/merge-branch@master
with:
type: now
from_branch: changeset-release/main
target_branch: dev
message: 'ci: 👷 update dev branch'
github_token: ${{ secrets.GITHUB_TOKEN }}

34
.github/workflows/release-preview.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: 👷 Release preview
on:
workflow_run:
workflows:
- 🧪 Code checking
types:
- completed
branches:
- dev
jobs:
release:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.repository == 'loreddev/marknow' }}
name: Release preview
env:
HUSKY: 0
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup environment
uses: ./.github/actions/pnpm-setup
- name: Update versions
run: pnpm changeset version --snapshot next
- name: Release packages
run: pnpm run release --tag next
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}