feat: add github action ci

This commit is contained in:
JinmingYang
2023-06-19 11:48:30 +08:00
parent bcfb0505eb
commit ba989345ab
4 changed files with 134 additions and 0 deletions

2
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,2 @@
github: [nicepkg, 2214962083]
open_collective: nicepkg

14
.github/stale.yml vendored Normal file
View File

@@ -0,0 +1,14 @@
daysUntilStale: 60
daysUntilClose: 7
exemptLabels:
- pinned
- security
- no-stale
- no stale
- pr welcome
staleLabel: stale
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
closeComment: false

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

@@ -0,0 +1,71 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Set node
uses: actions/setup-node@v3
with:
node-version: 19
cache: pnpm
- name: Install And Build
run: pnpm i
- name: Lint
run: pnpm lint
# test:
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ubuntu-latest]
# node_version: [16.20.0, 19]
# include:
# - os: macos-latest
# node_version: 19
# - os: windows-latest
# node_version: 19
# fail-fast: false
# steps:
# - name: Set git to use LF
# run: |
# git config --global core.autocrlf false
# git config --global core.eol lf
# - uses: actions/checkout@v3
# - name: Install pnpm
# uses: pnpm/action-setup@v2
# - name: Set node ${{ matrix.node_version }}
# uses: actions/setup-node@v3
# with:
# node-version: ${{ matrix.node_version }}
# cache: pnpm
# - name: Install And Build
# run: pnpm i
# - name: Test
# run: pnpm test
# - name: Typecheck
# run: pnpm typecheck

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

@@ -0,0 +1,47 @@
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: 19
cache: pnpm
registry-url: 'https://registry.npmjs.org'
- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Install Dependencies And Build
run: pnpm i
- name: Publish to NPM
run: pnpm -r publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true
# - name: Publish to VSCE & OVSX
# run: npm run publish
# working-directory: ./packages/gpt-runner-vscode
# env:
# VSCE_TOKEN: ${{secrets.VSCE_TOKEN}}
# OVSX_TOKEN: ${{secrets.OVSX_TOKEN}}