Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #10 from Yuhanawa/Allnew
Browse files Browse the repository at this point in the history
Allnew
  • Loading branch information
Yuhanawa authored Jul 26, 2024
2 parents a445b0d + 7d597a2 commit c94d18f
Show file tree
Hide file tree
Showing 218 changed files with 8,530 additions and 10,791 deletions.
68 changes: 30 additions & 38 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,69 +1,61 @@
name: Build
name: Update Versions and Upload to Releases Branch

on:
push:
branches:
- master
workflow_dispatch:

jobs:
build:
update-and-release:
if: ${{ github.actor != 'github-actions[bot]' }}

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v2.2.4
uses: pnpm/action-setup@v4
with:
version: latest
run_install: true

- name: Install dependencies
run: pnpm install

- name: Update-versions
- name: Update versions
run: pnpm run update-versions

- name: Build
run: pnpm run build

- name: Git config
- name: Configure Git
run: |
git config --local user.email github-actions[bot]@users.noreply.github.com
git config --local user.name github-actions[bot]
git config --global core.autocrlf true
git config --global core.safecrlf false
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Check changes
id: check
- name: Check for changes in userscripts
id: check_changes
run: |
changed=$(git diff --name-only remotes/origin/master..remotes/origin/releases -- src)
if [ -n "$changed" ]; then
echo "::set-output name=has_changes::true"
else
echo "::set-output name=has_changes::false"
git add userscripts
if git diff --staged --quiet; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
- name: Commit versions-update
if: steps.check.outputs.has_changes == 'true'
- name: Commit and push to master
if: steps.check_changes.outputs.has_changes == 'true'
run: |
git add src
git commit -m "Update versions"
git commit -m "ci: Update versions"
git push origin master
- name: Push to ref
if: steps.check.outputs.has_changes == 'true'
- name: Create and push to releases branch
run: |
git push origin HEAD:${{ github.ref_name }}
- name: Commit releases
run: |
git add -f out
git commit -m "CI build"
- name: Push to releases
run: |
git push -f origin HEAD:releases
git checkout --orphan releases
git rm -rf .
if [ ! -d "dist/userscripts" ]; then
echo "Error: dist/userscripts directory not found" >&2
exit 1
fi
git add dist
git commit -m "ci: Update release files"
git push origin releases --force
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dist
gmu.dev.json

### VisualStudioCode template
.vscode/*
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#### [[Github]](https://github.com/yuhanawa/UserScript) - [[Greasyfork-BILIBILI]](https://greasyfork.org/zh-CN/scripts/471069) - [[Greasyfork-CSDN]](https://greasyfork.org/zh-CN/scripts/471071) - [[Greasyfork-Twitter]](https://greasyfork.org/zh-CN/scripts/473865) - [[Greasyfork-博客园]](https://greasyfork.org/zh-CN/scripts/487754)

> !在学校坐牢中...
> !所有bug和反馈将在暑假进行处理

## 脚本

Expand Down
3 changes: 1 addition & 2 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"enabled": true,
"rules": {
"suspicious": {
"noConfusingLabels": "off",
"noCommaOperator": "off"
"noConfusingLabels": "off"
},
"style": {}
}
Expand Down
1 change: 1 addition & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ["@commitlint/config-conventional"] };
20 changes: 0 additions & 20 deletions config-component/.eslintrc.cjs

This file was deleted.

2 changes: 0 additions & 2 deletions config-component/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/scripts/

# Logs
logs
*.log
Expand Down
14 changes: 8 additions & 6 deletions config-component/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>config-component</title>
<script type="text/javascript">
window.ConfigWeb = true
</script>
<title>Notice</title>
</head>

<body>
<div id="config-web-root"></div>
<script type="module" src="/src/main.jsx"></script>
<h1>请将脚本升级到最新版本</h1>
<main>
<li><a href="https://greasyfork.org/scripts?set=587291">脚本集</a></li>
<li><a href="https://greasyfork.org/scripts/471071">CSDN 美化净化脚本</a></li>
<li><a href="https://greasyfork.org/scripts/471069">BiliBili 美化增强脚本</a></li>
<li><a href="https://greasyfork.org/scripts/487754">cnblogs 博客花园脚本</a></li>
</main>
</body>

</html>
22 changes: 1 addition & 21 deletions config-component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,9 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"antd": "^5.7.2",
"form-render": "^2.2.13",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-to-webcomponent": "^2.0.0"
},
"devDependencies": {
"@biomejs/biome": "^1.5.3",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@vitejs/plugin-react-swc": "^3.3.2",
"eslint": "^8.45.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"terser": "^5.27.0",
"vite": "^4.4.5",
"vite-plugin-cdn-import": "^0.3.5",
"vite-plugin-cdn2": "^1.1.0",
"vite-plugin-compression": "^0.5.1"
"vite": "^5.3.4"
}
}
Loading

0 comments on commit c94d18f

Please sign in to comment.