Skip to content

Commit

Permalink
ci: release
Browse files Browse the repository at this point in the history
  • Loading branch information
kuizuo committed Nov 17, 2023
1 parent ff1c7ab commit f7ca976
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 22 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

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

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

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

- name: Install
run: nci

- name: Lint
run: nr lint

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

strategy:
matrix:
os: [ubuntu-latest]
node_version: [18, lts/*]
include:
- os: macos-latest
node_version: lts/*
- os: windows-latest
node_version: lts/*
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

- run: corepack enable

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

- name: Install
run: nci

- name: Build
run: nr website:build

- name: Test
run: nr test
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release

permissions:
contents: write

on:
push:
tags:
- 'v*'

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

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

- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
.DS_Store
.vite-ssg-dist
.vite-ssg-temp
*.local
dist
dist-ssr
node_modules
.idea/
*.log
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"website:generate": "pnpm run -C website generate",
"website:serve": "pnpm run -C website serve",
"lint": "eslint './{packages,website,scripts,meta}/**/*.{js,ts,tsx,vue,md,json}'",
"lint:fix": "nr lint --fix",
"release": "bumpp -r",
"test": "vitest"
},
"workspaces": [
Expand All @@ -21,6 +23,7 @@
"bumpp": "^9.2.0",
"eslint": "^8.53.0",
"prettier": "^3.0.3",
"typescript": "^5.2.2"
"typescript": "^5.2.2",
"vitest": "^0.18.0"
}
}
7 changes: 2 additions & 5 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"name": "@deob/utils",
"type": "module",
"version": "0.1.0",
"private": true,
"main": "main.js",
"module": "main.js",
"files": [
"dist"
],
"dependencies": {
"@babel/core": "^7.18.9",
"crypto-js": "^4.1.1",
Expand All @@ -17,7 +15,6 @@
"@types/babel__traverse": "^7.17.1",
"@types/crypto-js": "^4.1.1",
"@types/lodash": "^4.14.182",
"typescript": "^5.2.2",
"vitest": "^0.18.0"
"typescript": "^5.2.2"
}
}
3 changes: 1 addition & 2 deletions play/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "play",
"private": true,
"main": "index.js",
"type": "module",
"private": true,
"devDependencies": {
"@deob/utils": "workspace:*"
}
Expand Down
21 changes: 10 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f7ca976

Please sign in to comment.