Skip to content

Commit

Permalink
rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
Celetor committed Oct 3, 2024
1 parent 059a323 commit 58dab6b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 30 deletions.
53 changes: 25 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: Build

on:
schedule:
- cron: 6 */3 * * *
# push:
# branches:
# - main
- cron: 6 */6 * * *
# push:
# branches:
# - main
workflow_dispatch:
inputs:
arm64_support:
description: 'arm64 is supported, but ijk decoder is not supported.'
rebuild:
description: 'rebuild but not release'
required: false
type: boolean

Expand All @@ -29,7 +29,6 @@ jobs:
branchName: main
javaVersion: 17
env:
local_xwalk: ${{ secrets.LOCAL_XWALK }}
# 登录蓝奏云后在控制台运行document.cookie
ylogin: ${{ secrets.YLOGIN }}
phpdisk_info: ${{ secrets.PHPDISK_INFO }}
Expand All @@ -46,11 +45,14 @@ jobs:
- name: Get The Lastest Commit
working-directory: actions
run: |
commit=$(curl -sL ${{ matrix.repoUrl }}/commits/${{ matrix.branchName }} |grep -o '/commit/[a-z0-9]\+' |head -1 | cut -d\/ -f3)
# if ! git log --oneline |grep -q "$commit"; then
commit=$(curl -sL ${{ secrets.PROXY_URL }}${{ matrix.repoUrl }}/commits/${{ matrix.branchName }} |grep -o '/commit/[a-z0-9]\+' |head -1 | cut -d\/ -f3)
echo "commit: $commit"
if ! grep -q "$commit" ./log/${{ matrix.userName }}.txt; then
echo "commit=$commit" >> $GITHUB_ENV
echo "commit_id=${commit:0:7}" >> $GITHUB_ENV
elif [[ "${{ inputs.rebuild }}" == "true" ]] ; then
echo "commit=$commit" >> $GITHUB_ENV
echo "commit_id=${commit:0:7}" >> $GITHUB_ENV
fi
- name: Clone Source Code
Expand All @@ -64,16 +66,8 @@ jobs:
run: |
echo "tag=$(git log --date=format:'%Y.%m%d.%H%M' --pretty=format:%cd ${{ env.commit_id }} -1)" >> $GITHUB_ENV
echo "update_time=$(git log --date=format:'%Y/%m/%d %H:%M' --pretty=format:%cd ${{ env.commit_id }} -1)" >> $GITHUB_ENV
# tar -cJf source-${{ env.commitS }}.tar.xz --exclude=.git --exclude=.github *
zip -q -x ".git/*" -r ${{ matrix.userName }}_${{ env.commit_id }}_src.zip .
- name: Arm64 Support Beta
if: ${{ inputs.arm64_support }}
working-directory: TVBoxOSC
run: |
sed -i "/armeabi-v7a[\'\"]$/s#\$#, 'arm64-v8a'#" app/build.gradle
sed -i "/armeabi-v7a[\'\"]$/s#\$#, 'arm64-v8a'#" player/build.gradle
- name: Add Sign Info
if: ${{ env.commit }}
working-directory: TVBoxOSC
Expand All @@ -88,17 +82,19 @@ jobs:
sed -i '$a\RELEASE_KEY_ALIAS=TVBoxOSC' ./gradle.properties
sed -i '$a\RELEASE_STORE_PASSWORD=TVBoxOSC' ./gradle.properties
sed -i '$a\RELEASE_KEY_PASSWORD=TVBoxOSC' ./gradle.properties
- name: Extra Modify
if: ${{ env.commit }}
working-directory: TVBoxOSC
run: |
echo "modify version info"
version_code=$(git rev-list --count HEAD)
echo "version code: $version_code"
sed -i "/ versionCode/c\\versionCode ${version_code}" ./app/build.gradle
sed -i "/ versionName/c\\versionName '${{ env.tag }}'" ./app/build.gradle
sed -i "/ applicationId/c\\applicationId '${{ matrix.userName }}.tvbox.osc'" ./app/build.gradle
sed -i "/android:text=/c\\ android:text=\"v${{ env.tag }}\\\\n本软件只提供聚合展示功能,所有资源来自网上, 软件不参与任何制作, 上传, 储存, 下载等内容。 软件仅供学习参考, 请于安装后24小时内删除。\\\\n\\\\n打包分发请保留出处\\\\n${{ matrix.repoUrl }}\"" ./app/src/main/res/layout/dialog_about.xml
- name: Fix Xwalk Library
if: ${{ env.commit && env.local_xwalk }}
working-directory: TVBoxOSC
run: |
echo "fix library"
if grep -q 'crosswalk' build.gradle; then
sed -i "/crosswalk/a\ maven { url 'https://celetor.github.io/crosswalk/releases/crosswalk/android/maven2' }\n maven { url 'https://maven.aliyun.com/repository/jcenter' }" build.gradle
else
Expand Down Expand Up @@ -137,8 +133,9 @@ jobs:
echo "ignore: $file"
elif [[ $filename =~ "release" ]] ; then
echo "move and rename: $file"
match_name=${filename##*release}
new_name="TVBox_${{ matrix.userName }}_${{ env.tag }}$match_name"
match_name=${filename%.*}
match_name=${match_name##*release}
new_name="TVBox${match_name}_${{ matrix.userName }}_${{ env.tag }}.apk"
echo "new_name: $new_name"
mv "$file" "apk/$new_name"
else
Expand All @@ -162,12 +159,12 @@ jobs:
else
COMMIT_MESSAGE=$(git log --pretty=format:%B ${{ env.commit_id }}...${myLastCommit:0:7} |sed -e 's# \{2,\}#\n#g' -e '/^Merge pull/d' -e 's#"#\\"#g' -e '/^$/d' |cat -n |sort -k2,2 -k1,1n |uniq -f1 |sort -k1,1n |cut -f2- )
fi
echo -e "Credit: [${{ matrix.userName }}](${{ matrix.repoUrl }})\n${COMMIT_MESSAGE}" > Changelog.txt
echo -e "Credit: [${{ matrix.userName }}](${{ matrix.repoUrl }})\n\`\`\`${COMMIT_MESSAGE}\n\`\`\`" > Changelog.txt
echo "$COMMIT_MESSAGE" > desc.txt
- name: Release App
uses: softprops/action-gh-release@v2
if: ${{ env.commit }}
if: ${{ env.commit && !inputs.rebuild }}
with:
name: ${{ env.tag }}
tag_name: ${{ env.tag }}_${{ matrix.userName }}
Expand All @@ -179,7 +176,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Commit And Push
if: ${{ env.commit }}
if: ${{ env.commit && !inputs.rebuild }}
working-directory: actions
continue-on-error: true
run: |
Expand All @@ -194,5 +191,5 @@ jobs:
git push origin main
- name: Upload App To Lanzou
if: ${{ env.commit && env.ylogin }}
if: ${{ env.commit && env.ylogin && !inputs.rebuild }}
run: python3 ${{ github.workspace }}/actions/.github/scripts/lanzou-api.py "${{ github.workspace }}/TVBoxOSC/apk/" "$lanzou_folder_id" "${{ github.workspace }}/TVBoxOSC/desc.txt"
2 changes: 1 addition & 1 deletion log/q215613905.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1a94c846b5845c0556decb1c2c2ca19db2fabe07
8b63bf8958d16626ca28e1695eecfa8de22e7628
2 changes: 1 addition & 1 deletion log/takagen99.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2820da6d3fd3a63b0817fd16fb5c8b7199be0286
06bfe75bffefbef060785408d5712a960779ec79

0 comments on commit 58dab6b

Please sign in to comment.