mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2026-06-07 20:48:09 +08:00
update: 更新配置脚本文件
This commit is contained in:
parent
dc4bfb4b01
commit
c0163fb16e
22
.github/delete_tags_and_releases.py
vendored
Normal file
22
.github/delete_tags_and_releases.py
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import os
|
||||||
|
from github import Github
|
||||||
|
|
||||||
|
def delete_all_releases(repo):
|
||||||
|
for release in repo.get_releases():
|
||||||
|
try:
|
||||||
|
release.delete_release()
|
||||||
|
print(f"Deleted release: {release.title}")
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Failed to delete release {release.title}: {e}")
|
||||||
|
|
||||||
|
def main():
|
||||||
|
token = os.getenv("GITHUB_TOKEN")
|
||||||
|
repo_name = os.getenv("GITHUB_REPOSITORY").split('/')[-1] # 获取仓库名
|
||||||
|
owner = os.getenv("GITHUB_REPOSITORY").split('/')[0] # 获取仓库所有者
|
||||||
|
g = Github(token)
|
||||||
|
repo = g.get_repo(f"{owner}/{repo_name}")
|
||||||
|
|
||||||
|
delete_all_releases(repo)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
29
.github/workflows/clear.yml
vendored
Normal file
29
.github/workflows/clear.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
name: Clear Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
delete:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.x'
|
||||||
|
|
||||||
|
- name: Install PyGithub
|
||||||
|
run: pip install PyGithub
|
||||||
|
|
||||||
|
- name: Delete all GitHub tags
|
||||||
|
run: |
|
||||||
|
# 获取所有 tag 的列表
|
||||||
|
TAGS=$(git ls-remote --tags origin | cut -f2 | cut -d'/' -f3)
|
||||||
|
|
||||||
|
# 循环遍历所有 tag 并删除
|
||||||
|
for TAG in $TAGS; do
|
||||||
|
curl -s -X DELETE "https://api.github.com/repos/${{ github.repository }}/git/refs/tags/$TAG" -H "Authorization: token ${{ secrets.TOKEN }}"
|
||||||
|
done
|
||||||
29
.github/workflows/release.yml
vendored
29
.github/workflows/release.yml
vendored
@ -4,23 +4,42 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
||||||
|
|
||||||
name: Release
|
name: Create Release
|
||||||
permissions: write-all
|
permissions: write-all
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
name: Release
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm install -g conventional-changelog-cli
|
||||||
|
|
||||||
|
- name: Find last tag
|
||||||
|
id: last_tag
|
||||||
|
run: echo "::set-output name=tag::$(git describe --tags --abbrev=0 || echo 'v0.0.0')"
|
||||||
|
|
||||||
|
- name: Generate changelog since last tag
|
||||||
|
run: |
|
||||||
|
conventional-changelog -p angular -i CHANGELOG.md -s -r ${{ steps.last_tag.outputs.tag }}..HEAD
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: actions/create-release@v1
|
uses: actions/create-release@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.TOKEN }}
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ github.ref }}
|
tag_name: ${{ steps.last_tag.outputs.tag }}
|
||||||
release_name: Release ${{ github.ref }}
|
release_name: Release ${{ steps.last_tag.outputs.tag }}
|
||||||
|
body_path: CHANGELOG.md
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -5,7 +5,7 @@
|
|||||||
.fleet
|
.fleet
|
||||||
.vscode
|
.vscode
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
/vendor
|
/vendor
|
||||||
/runtime
|
/runtime
|
||||||
/safefile
|
/safefile
|
||||||
|
|||||||
@ -21,7 +21,7 @@ use think\admin\Controller;
|
|||||||
class Index extends Controller
|
class Index extends Controller
|
||||||
{
|
{
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$this->redirect(sysuri('admin/login/index'));
|
$this->redirect(sysuri('admin/login/index'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
11
bin/clearTag.cmd
Normal file
11
bin/clearTag.cmd
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal
|
||||||
|
|
||||||
|
echo Deleting remote tags...
|
||||||
|
for /f "delims=" %%x in ('git tag') do git push --delete origin %%x
|
||||||
|
|
||||||
|
echo Deleting local tags...
|
||||||
|
for /f "delims=" %%i in ('git tag') do git tag -d %%i
|
||||||
|
|
||||||
|
echo All tags deleted.
|
||||||
|
pause
|
||||||
26
plugin/think-plugs-static/.github/workflows/release.yml
vendored
Normal file
26
plugin/think-plugs-static/.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
on:
|
||||||
|
push:
|
||||||
|
# Sequence of patterns matched against refs/tags
|
||||||
|
tags:
|
||||||
|
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
||||||
|
|
||||||
|
name: Release
|
||||||
|
permissions: write-all
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
name: Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Create Release
|
||||||
|
id: create_release
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: ${{ github.ref }}
|
||||||
|
release_name: Release ${{ github.ref }}
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
@ -17,7 +17,7 @@ composer update --optimize-autoloader
|
|||||||
# 运行本地测试环境,启用 8088 商品
|
# 运行本地测试环境,启用 8088 商品
|
||||||
php think run --host 127.0.0.1 --port 8088
|
php think run --host 127.0.0.1 --port 8088
|
||||||
|
|
||||||
# 打开浏览器访问网站 ( Windows )
|
# 打开浏览器访问网站 ( Windows )
|
||||||
start http://127.0.0.1:8088
|
start http://127.0.0.1:8088
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user