Skip to content

Commit

Permalink
update: yml
Browse files Browse the repository at this point in the history
  • Loading branch information
lizhiyuan committed Aug 22, 2024
1 parent df1aafb commit 7e8f131
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 6 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: CI

on:
# push:
# branches:
# - main

# pull_request:
# branches:
# - main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Set node
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Lint
run: pnpm lint:fix

# test:
# runs-on: ${{ matrix.os }}

# strategy:
# matrix:
# node: [lts/*]
# os: [ubuntu-latest, windows-latest, macos-latest]
# fail-fast: false

# steps:
# - uses: actions/checkout@v4

# - name: Install pnpm
# uses: pnpm/action-setup@v4

# - name: Set node version to ${{ matrix.node }}
# uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node }}
# cache: pnpm

# - name: Setup
# run: npm i -g @antfu/ni

# - name: Install
# run: nci

# - name: Build
# run: nr build

# - name: Test
# run: nr test
6 changes: 3 additions & 3 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: lts/*
cache: 'pnpm'

- name: Install dependencies
Expand All @@ -35,7 +35,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: lts/*
- run: pnpm build:lib
# - run: pnpm test

Expand All @@ -46,7 +46,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: lts/*
registry-url: https://registry.npmjs.org/
- run: npm publish
env:
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Release

permissions:
contents: write

on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

push:
tags:
- 'v*'

jobs:
cache-and-install:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm

- name: Install dependencies
run: pnpm install
build:
needs: cache-and-install
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: lts/*
- run: pnpm build:lib
# - run: pnpm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
registry-url: https://registry.npmjs.org/
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

release:
needs: publish-npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: lts/*

- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
9 changes: 6 additions & 3 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
# push:
# branches: ["main"]
# branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -18,7 +18,7 @@ permissions:
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
group: pages
cancel-in-progress: false

jobs:
Expand All @@ -31,13 +31,16 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload docs catalog
path: './docs'
path: ./docs

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 7e8f131

Please sign in to comment.