mirror of
https://github.com/lutinglt/gitea-github-theme.git
synced 2025-12-21 22:23:56 +00:00
build test
This commit is contained in:
49
.github/workflows/build.yml
vendored
Normal file
49
.github/workflows/build.yml
vendored
Normal 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
|
||||||
@@ -9,7 +9,8 @@
|
|||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
"commit": "npm run lint && npm run format && npm run build",
|
"commit": "npm run lint && npm run format && npm run build",
|
||||||
"version": "node scripts/version.cjs",
|
"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": {
|
"devDependencies": {
|
||||||
"@babel/preset-typescript": "^7.28.4",
|
"@babel/preset-typescript": "^7.28.4",
|
||||||
|
|||||||
5
scripts/translate.ts
vendored
Normal file
5
scripts/translate.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import * as dotenv from "dotenv";
|
||||||
|
|
||||||
|
dotenv.config({ quiet: true });
|
||||||
|
|
||||||
|
console.log(process.env.GITEA_PATH);
|
||||||
Reference in New Issue
Block a user