feat: git workflows

This commit is contained in:
Bereket Engida
2024-09-02 13:19:24 +03:00
parent 94919e7d48
commit 6378334b61
4 changed files with 90 additions and 1 deletions

39
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,39 @@
name: CI
on:
pull_request:
branches: main
push:
branches: main
merge_group: {}
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
cache: pnpm
- name: Install
run: pnpm install
- name: Build
run: pnpm build
- name: lint
run: pnpm lint
- name: test
run: pnpm test
- name: typecheck
run: pnpm typecheck

50
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,50 @@
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
permissions:
contents: write
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
- run: pnpm install
- name: Build
run: pnpm build
- name: Check version
id: check_version
run: |
tag=$(echo ${GITHUB_REF#refs/tags/})
if [[ $tag == *"beta"* ]]; then
echo "::set-output name=tag::beta"
elif [[ $tag == *"alpha"* ]]; then
echo "::set-output name=tag::alpha"
else
echo "::set-output name=tag::latest"
fi
- name: Publish to npm
run: pnpm -r publish --access public --no-git-checks --tag ${{steps.check_version.outputs.tag}}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

View File

@@ -368,7 +368,6 @@ export const contents: Content[] = [
icon: MailCheck, icon: MailCheck,
href: "/docs/plugins/email-verifier", href: "/docs/plugins/email-verifier",
}, },
], ],
}, },
]; ];

View File

@@ -8,6 +8,7 @@
"build": "turbo --filter \"./packages/*\" build", "build": "turbo --filter \"./packages/*\" build",
"dev": "turbo --filter \"./packages/*\" dev", "dev": "turbo --filter \"./packages/*\" dev",
"clean": "turbo --filter \"./packages/*\" clean && rm -rf node_modules", "clean": "turbo --filter \"./packages/*\" clean && rm -rf node_modules",
"bump": "bumpp -r",
"format": "biome format . --write", "format": "biome format . --write",
"lint": "biome check .", "lint": "biome check .",
"lint:fix": "biome check . --apply", "lint:fix": "biome check . --apply",