-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (50 loc) · 1.65 KB
/
module.yml
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
name: Tạo module
on:
workflow_dispatch:
push:
paths:
- '.github/workflows/module.yml'
- '.github/Tvip.sh'
- '.github/Widget/*'
permissions: write-all
jobs:
build:
name: 'See progress'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: 'Start process'
run: |
# Kakathic
TOME="$GITHUB_WORKSPACE"
getmodun(){ grep -m1 "$1=" $TOME/.github/Widget/module.prop | cut -d= -f2; }
upenv(){ echo "$1=$2" >> $GITHUB_ENV; eval "$1=$2"; }
upenv VUR "$(getmodun version)"
upenv VSR "$(getmodun versionCode)"
chmod 777 .github/Tvip.sh
.github/Tvip.sh
cp -rf vip.sh .github/Widget/bin
cd .github/Widget
zip -r $GITHUB_WORKSPACE/WidgetOS_$(getmodun version).zip *
cd $GITHUB_WORKSPACE
cat $TOME/.github/Along.md | sed -n "/#### $VER/,/####/P" | sed "/#/d" | sed '1d' | sed '$d' >$TOME/log.txt
echo '{
"version": "'$VUR'",
"versionCode": "'$VSR'",
"zipUrl": "https://github.com/Zenlua/Widget/releases/download/V'$VUR'/WidgetOS_'${VUR}'.zip",
"changelog": "https://raw.githubusercontent.com/Zenlua/Widget/main/.github/Along.md"
}' > $TOME/widgetos.json
- name: Upload zip
uses: softprops/action-gh-release@v2
with:
name: WidgetOS ${{ env.VUR }}
tag_name: V${{ env.VUR }}
files: ./*.zip
body_path: log.txt
- name: Upload json
uses: softprops/action-gh-release@v1
with:
name: Tmp
tag_name: tmp
files: ./*.json