ci(projects): add github actions config

This commit is contained in:
Soybean
2024-03-25 10:26:58 +08:00
parent 46b6156620
commit 4cb17c7440
5 changed files with 252 additions and 0 deletions

30
.github/workflows/linter.yml vendored Normal file
View File

@ -0,0 +1,30 @@
---
name: Lint Code
permissions:
contents: write
on:
pull_request:
branches: [main]
jobs:
lint:
name: Lint All Code
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Lint Code Base
uses: github/super-linter@v4
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: main
# To change branch master or main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILTER_REGEX_EXCLUDE: (docs|.github)
VALIDATE_MARKDOWN: false

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

@ -0,0 +1,31 @@
name: Release
on:
push:
tags:
- "v*"
jobs:
release:
permissions:
id-token: write
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Set node
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: pnpm
registry-url: "https://registry.npmjs.org"
- run: npx githublogen
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}