mirror of
https://github.com/lutinglt/gitea-github-theme.git
synced 2025-10-26 13:00:31 +00:00
发布流程简化
This commit is contained in:
16
.github/release.js
vendored
Normal file
16
.github/release.js
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
const fs = require('fs').promises;
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
|
||||||
|
async function parseYaml() {
|
||||||
|
try {
|
||||||
|
const fileContents = await fs.readFile('./theme.yml', 'utf8');
|
||||||
|
const data = yaml.load(fileContents);
|
||||||
|
|
||||||
|
console.log(data.gitea.version);
|
||||||
|
} catch (e) {
|
||||||
|
console.error('Error parsing YAML:', e.message);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parseYaml();
|
||||||
16
.github/workflows/release.yml
vendored
16
.github/workflows/release.yml
vendored
@@ -2,10 +2,6 @@ name: release
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
|
||||||
gitea_version:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@@ -18,18 +14,12 @@ jobs:
|
|||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
- name: Build theme
|
- name: NPM install
|
||||||
run: |
|
run: npm install
|
||||||
npm install
|
|
||||||
npm run build
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: theme-github
|
|
||||||
path: dist/*
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
run: |
|
run: |
|
||||||
export TZ=Asia/Shanghai
|
export TZ=Asia/Shanghai
|
||||||
TAG="v${{ inputs.gitea_version }}-$(date +%Y%m%d-%H%M)"
|
TAG="v$(node .github/release.js)-$(date +%y%m%d%H%M)"
|
||||||
gh release create "$TAG" dist/* --notes-file .github/release.md --draft -t $TAG
|
gh release create "$TAG" dist/* --notes-file .github/release.md --draft -t $TAG
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,2 @@
|
|||||||
dist
|
|
||||||
node_modules
|
node_modules
|
||||||
package-lock.json
|
package-lock.json
|
||||||
1
dist/theme-github.css
vendored
Normal file
1
dist/theme-github.css
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -19,6 +19,7 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/lutinglt/gitea-github-theme#readme",
|
"homepage": "https://github.com/lutinglt/gitea-github-theme#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"js-yaml": "^4.1.0",
|
||||||
"sass": "^1.83.0"
|
"sass": "^1.83.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user