build test

This commit is contained in:
lutinglt
2025-12-02 14:37:32 +08:00
parent 86e488aafb
commit 76e547987b
3 changed files with 56 additions and 1 deletions

49
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: release
on:
push:
branches:
- main
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
src:
- "scripts/*"
- "src/*.ts"
- "styles/*.ts"
- "themes/*.ts"
- "vite.config.ts"
- "package.json"
- name: Build theme
id: build
if: steps.changes.outputs.src == 'true'
run: |
npm install
npm run build
env:
GH_TOKEN: ${{ github.token }}
- name: Upload css assets
if: steps.build.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: themes
path: dist/*.css
- name: Upload templates assets
if: steps.build.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: templates
path: templates

View File

@@ -9,7 +9,8 @@
"format": "prettier --write .",
"commit": "npm run lint && npm run format && npm run build",
"version": "node scripts/version.cjs",
"install:clean": "npm cache clean --force && rm -rf node_modules package-lock.json && npm install"
"install:clean": "npm cache clean --force && rm -rf node_modules package-lock.json && npm install",
"tr": "node scripts/translate.ts"
},
"devDependencies": {
"@babel/preset-typescript": "^7.28.4",

5
scripts/translate.ts vendored Normal file
View File

@@ -0,0 +1,5 @@
import * as dotenv from "dotenv";
dotenv.config({ quiet: true });
console.log(process.env.GITEA_PATH);