forked from Zhuwenxue2002/SwitchScript
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (56 loc) · 1.43 KB
/
Copy pathswitchScript.yaml
File metadata and controls
65 lines (56 loc) · 1.43 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
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@v4
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.GITHUB_TOKEN }}
body: "${{ steps.description.outputs.content }}"
artifacts: "SwitchSD.zip"
- name: Remove old Releases
uses: dev-drprasad/delete-older-releases@v0.3.2
with:
keep_latest: 5
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}