Skip to content

Update module.yml

Update module.yml #25

Workflow file for this run

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