forked from huangqian8/SwitchScript
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (63 loc) · 1.69 KB
/
Copy pathswitchScript.yaml
File metadata and controls
73 lines (63 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: switchScript
on:
push:
branches:
- main
paths:
- 'README.md'
- 'switchScript.sh'
#schedule:
# - cron: 0 8 * * *
workflow_dispatch:
env:
SCRIPT_SH: switchScript.sh
TZ: Asia/Shanghai
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: main
- name: Initialization environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo -E apt install -y jq
- name: "Build & Release"
run: |
echo "DATE=$(date "+%Y-%m-%d %H:%M:%S")" >> $GITHUB_ENV
echo "tag_name=$(date +%Y%m%d)" >> $GITHUB_ENV
chmod +x $SCRIPT_SH
./$SCRIPT_SH
zip -rq SwitchSD.zip SwitchSD
- name: Read description.txt
id: description
uses: juliangruber/read-file-action@v1
with:
path: ./description.txt
- name: Create release
uses: ncipollo/release-action@v1
with:
name: ${{ env.DATE }} ❤️ | 大气层个人整合包
allowUpdates: true
tag: ${{ env.tag_name }}
commit: main
token: ${{ secrets.actions_release }}
body: "${{ steps.description.outputs.content }}"
artifacts: "SwitchSD.zip"
- name: Remove old Releases
uses: dev-drprasad/delete-older-releases@v0.3.4
with:
keep_latest: 5
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.actions_release }}
- name: Delete workflow runs for current repo
uses: Mattraks/delete-workflow-runs@v2.1.0
with:
token: ${{ secrets.actions_release }}
repository: ${{ github.repository }}
retain_days: 7
keep_minimum_runs: 6