Skip to content

Commit

Permalink
chore: github release
Browse files Browse the repository at this point in the history
  • Loading branch information
ChangJun2019 committed Oct 6, 2023
1 parent 78aa486 commit 826db5e
Show file tree
Hide file tree
Showing 5 changed files with 487 additions and 1 deletion.
61 changes: 61 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release

permissions:
contents: write

on:
push:
tags:
- 'v*'

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

- uses: actions/setup-node@v3
with:
node-version: 16.x

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 8
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: build
run: pnpm run build

- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Upload files to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*
tag: ${{ github.ref }}
overwrite: true
file_glob: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ node_modules
.stylelintcache
logs
*.log
dist
npm-debug.log*
yarn-debug.log*
yarn-error.log*
Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"scripts": {
"dev": "unocss --watch",
"build": "unocss --minify",
"build": "unocss --minify && esno ./scripts/build",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"upgrade": "npx taze major -w",
Expand All @@ -28,7 +28,13 @@
"@antfu/eslint-config": "1.0.0-beta.21",
"@unocss/cli": "^0.56.5",
"bumpp": "^9.2.0",
"compressing": "^1.10.0",
"consola": "^3.2.3",
"eslint": "^8.50.0",
"esno": "^0.17.0",
"mkdirp": "^3.0.1",
"rimraf": "^5.0.5",
"typescript": "^5.2.2",
"unocss": "^0.56.5"
}
}
Loading

0 comments on commit 826db5e

Please sign in to comment.