-
Notifications
You must be signed in to change notification settings - Fork 7
82 lines (70 loc) · 3.33 KB
/
Create Release.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Release
on:
push:
branches:
- main
jobs:
build:
name: Create Release
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Prepare Configuration
run: |
CONFIG_ENV=$(cat config.env | grep -w "CONFIG_ENV" | head -n 1 | cut -d "=" -f 2)
echo "MODULE_PACKAGING_PATH=$(cat $CONFIG_ENV | grep -w "MODULE_PACKAGING_PATHE" | head -n 1 | cut -d "=" -f 2)" >> $GITHUB_ENV
echo "ZIP_FILENAME=$(cat $CONFIG_ENV | grep -w "ZIP_FILENAME" | head -n 1 | cut -d "=" -f 2)" >> $GITHUB_ENV
echo "CONFIG_PATH=$(cat $CONFIG_ENV | grep -w "CONFIG_PATH" | head -n 1 | cut -d "=" -f 2)" >> $GITHUB_ENV
echo "CONFIG_NAME=$(cat $CONFIG_ENV | grep -w "CONFIG_NAME" | head -n 1 | cut -d "=" -f 2)" >> $GITHUB_ENV
echo "IS_PRERELEASE=$(cat $CONFIG_ENV | grep -w "IS_PRERELEASE" | head -n 1 | cut -d "=" -f 2)" >> $GITHUB_ENV
echo "VERSION=$(cat $CONFIG_ENV | grep -w "VERSION" | head -n 1 | cut -d "=" -f 2)" >> $GITHUB_ENV
echo "RELEASE_NOTES=$(cat $CONFIG_ENV | grep -w "RELEASE_NOTES" | head -n 1 | cut -d "=" -f 2)" >> $GITHUB_ENV
echo "FILE=$(cat $CONFIG_ENV | grep -w "FILE" | head -n 1 | cut -d "=" -f 2)" >> $GITHUB_ENV
echo "VERSIONCODE=$(cat $CONFIG_ENV | grep -w "VERSIONCODE" | head -n 1 | cut -d "=" -f 2)" >> $GITHUB_ENV
- name: Update VERSION
run: |
echo '{
"versionCode": ${ERSIONCODE},
"version": "${VERSION}",
"zipUrl": "https://github.moeyy.xyz/https://github.com/TimeBreeze/Tritium/releases/download/${VERSION}/Magisk_${VERSION}.zip",
"changelog": "https://github.moeyy.xyz/https://github.com/TimeBreeze/Tritium/blob/main/Tritium.json"
}' > Tritium.json
echo '{
id=ct_module
name=Tritium Scheduler
version=${ERSIONCODE}
versionCode=
author=Suni
description=Power By CuprumTrubo
updateJson=https://file.tritium.nightrainmilkyway.cn/Tritium.json
}' > ./magisk/module.prop
- name: Zip Module
run: |
cd $GITHUB_WORKSPACE/magisk
zip -r $GITHUB_WORKSPACE/${ZIP_FILENAME}_${VERSION}.zip ./*
cd configs
zip -r $GITHUB_WORKSPACE/${CONFIG_NAME}_${VERSION}.zip ./*
cd ../../.
- name: Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 使用 GitHub Token 访问权限
with:
tag_name: ${{ env.VERSION }}
body_path: ${{ github.workspace }}/changelog.md
name: Tritium_${{ env.VERSION }}
prerelease: ${{ env.IS_PRERELEASE }}
body: ${{ env.RELEASE_NOTES }}
files: ./*.zip
repository: TimeBreeze/Tritium
# note you'll typically need to create a personal access token
# with permissions to create releases in the other repo
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
- name: Push_changes
run: |
rm -rf ./*.zip
git config user.name "GitHub Action"
git config user.email "action@github.com"
git add .
git commit -m "Update HADE"
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}git@github.com:TimeBreeze/Tritium.git main