|
|
@ -4,6 +4,7 @@ on: |
|
|
|
push: |
|
|
|
push: |
|
|
|
branches: |
|
|
|
branches: |
|
|
|
- master |
|
|
|
- master |
|
|
|
|
|
|
|
workflow_dispatch: |
|
|
|
|
|
|
|
|
|
|
|
jobs: |
|
|
|
jobs: |
|
|
|
prepare: |
|
|
|
prepare: |
|
|
@ -11,11 +12,21 @@ jobs: |
|
|
|
outputs: |
|
|
|
outputs: |
|
|
|
version: ${{ steps.set-ver.outputs.version }} |
|
|
|
version: ${{ steps.set-ver.outputs.version }} |
|
|
|
versionL: ${{ steps.set-ver.outputs.versionL }} |
|
|
|
versionL: ${{ steps.set-ver.outputs.versionL }} |
|
|
|
|
|
|
|
lanzou: ${{ steps.check.outputs.lanzou }} |
|
|
|
|
|
|
|
telegram: ${{ steps.check.outputs.telegram }} |
|
|
|
steps: |
|
|
|
steps: |
|
|
|
- id: set-ver |
|
|
|
- id: set-ver |
|
|
|
run: | |
|
|
|
run: | |
|
|
|
echo "::set-output name=version::$(date -d "8 hour" -u +3.%y.%m%d%H)" |
|
|
|
echo "::set-output name=version::$(date -d "8 hour" -u +3.%y.%m%d%H)" |
|
|
|
echo "::set-output name=versionL::$(date -d "8 hour" -u +3.%y.%m%d%H%M)" |
|
|
|
echo "::set-output name=versionL::$(date -d "8 hour" -u +3.%y.%m%d%H%M)" |
|
|
|
|
|
|
|
- id: check |
|
|
|
|
|
|
|
run: | |
|
|
|
|
|
|
|
if [ ${{ secrets.LANZOU_ID }} ]; then |
|
|
|
|
|
|
|
echo "::set-output name=lanzou::yes" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
if [ ${{ secrets.BOT_TOKEN }} ]; then |
|
|
|
|
|
|
|
echo "::set-output name=telegram::yes" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
build: |
|
|
|
build: |
|
|
|
needs: prepare |
|
|
|
needs: prepare |
|
|
@ -24,7 +35,6 @@ jobs: |
|
|
|
product: [app, google] |
|
|
|
product: [app, google] |
|
|
|
type: [release, releaseA] |
|
|
|
type: [release, releaseA] |
|
|
|
fail-fast: false |
|
|
|
fail-fast: false |
|
|
|
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest |
|
|
|
runs-on: ubuntu-latest |
|
|
|
env: |
|
|
|
env: |
|
|
|
product: ${{ matrix.product }} |
|
|
|
product: ${{ matrix.product }} |
|
|
@ -56,6 +66,7 @@ jobs: |
|
|
|
sed '$a\RELEASE_STORE_PASSWORD=gedoor_legado' $GITHUB_WORKSPACE/gradle.properties -i |
|
|
|
sed '$a\RELEASE_STORE_PASSWORD=gedoor_legado' $GITHUB_WORKSPACE/gradle.properties -i |
|
|
|
sed '$a\RELEASE_KEY_PASSWORD=gedoor_legado' $GITHUB_WORKSPACE/gradle.properties -i |
|
|
|
sed '$a\RELEASE_KEY_PASSWORD=gedoor_legado' $GITHUB_WORKSPACE/gradle.properties -i |
|
|
|
- name: Build With Gradle |
|
|
|
- name: Build With Gradle |
|
|
|
|
|
|
|
continue-on-error: true |
|
|
|
run: | |
|
|
|
run: | |
|
|
|
if [ ${{ env.type }} == 'release' ]; then |
|
|
|
if [ ${{ env.type }} == 'release' ]; then |
|
|
|
typeName="原包名" |
|
|
|
typeName="原包名" |
|
|
@ -81,7 +92,8 @@ jobs: |
|
|
|
path: ${{ github.workspace }}/apk/*.apk |
|
|
|
path: ${{ github.workspace }}/apk/*.apk |
|
|
|
|
|
|
|
|
|
|
|
lanzou: |
|
|
|
lanzou: |
|
|
|
needs: build |
|
|
|
needs: [prepare, build] |
|
|
|
|
|
|
|
if: ${{ needs.prepare.outputs.lanzou }} |
|
|
|
runs-on: ubuntu-latest |
|
|
|
runs-on: ubuntu-latest |
|
|
|
env: |
|
|
|
env: |
|
|
|
# 登录蓝奏云后在控制台运行document.cookie |
|
|
|
# 登录蓝奏云后在控制台运行document.cookie |
|
|
@ -97,14 +109,13 @@ jobs: |
|
|
|
- working-directory: apk/ |
|
|
|
- working-directory: apk/ |
|
|
|
run: mv */*.apk . ;rm -rf */ |
|
|
|
run: mv */*.apk . ;rm -rf */ |
|
|
|
- name: Upload To Lanzou |
|
|
|
- name: Upload To Lanzou |
|
|
|
if: ${{ env.ylogin }} |
|
|
|
|
|
|
|
run: | |
|
|
|
run: | |
|
|
|
path="$GITHUB_WORKSPACE/apk/" |
|
|
|
path="$GITHUB_WORKSPACE/apk/" |
|
|
|
python3 $GITHUB_WORKSPACE/.github/scripts/lzy_web.py "$path" "$LANZOU_FOLDER_ID" |
|
|
|
python3 $GITHUB_WORKSPACE/.github/scripts/lzy_web.py "$path" "$LANZOU_FOLDER_ID" |
|
|
|
echo "[$(date -u -d '+8 hour' '+%Y.%m.%d %H:%M:%S')] 分享链接: https://kunfei.lanzoux.com/b0f810h4b" |
|
|
|
echo "[$(date -u -d '+8 hour' '+%Y.%m.%d %H:%M:%S')] 分享链接: https://kunfei.lanzoux.com/b0f810h4b" |
|
|
|
|
|
|
|
|
|
|
|
jsdelivr: |
|
|
|
test_Branch: |
|
|
|
needs: [prepare,build] |
|
|
|
needs: [prepare, build] |
|
|
|
runs-on: ubuntu-latest |
|
|
|
runs-on: ubuntu-latest |
|
|
|
steps: |
|
|
|
steps: |
|
|
|
- uses: actions/checkout@v2 |
|
|
|
- uses: actions/checkout@v2 |
|
|
@ -115,7 +126,7 @@ jobs: |
|
|
|
run: mv */*.apk . ;rm -rf */ |
|
|
|
run: mv */*.apk . ;rm -rf */ |
|
|
|
- name: Push To "test" Branch |
|
|
|
- name: Push To "test" Branch |
|
|
|
run: | |
|
|
|
run: | |
|
|
|
cd $GITHUB_WORKSPACE/apk || exit 1 |
|
|
|
cd $GITHUB_WORKSPACE/apk |
|
|
|
git init |
|
|
|
git init |
|
|
|
git config --local user.name "github-actions[bot]" |
|
|
|
git config --local user.name "github-actions[bot]" |
|
|
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" |
|
|
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" |
|
|
@ -124,11 +135,23 @@ jobs: |
|
|
|
git commit -m "${{ needs.prepare.outputs.versionL }}" |
|
|
|
git commit -m "${{ needs.prepare.outputs.versionL }}" |
|
|
|
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" |
|
|
|
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" |
|
|
|
git push -f -u origin test |
|
|
|
git push -f -u origin test |
|
|
|
- name: Purge jsdelivr cache |
|
|
|
|
|
|
|
|
|
|
|
telegram: |
|
|
|
|
|
|
|
needs: [prepare, build] |
|
|
|
|
|
|
|
if: ${{ needs.prepare.outputs.telegram }} |
|
|
|
|
|
|
|
runs-on: ubuntu-latest |
|
|
|
|
|
|
|
env: |
|
|
|
|
|
|
|
CHANNEL_ID: ${{ secrets.CHANNEL_ID }} |
|
|
|
|
|
|
|
BOT_TOKEN: ${{ secrets.BOT_TOKEN }} |
|
|
|
|
|
|
|
steps: |
|
|
|
|
|
|
|
- uses: actions/checkout@v2 |
|
|
|
|
|
|
|
- uses: actions/download-artifact@v2 |
|
|
|
|
|
|
|
with: |
|
|
|
|
|
|
|
path: apk/ |
|
|
|
|
|
|
|
- working-directory: apk/ |
|
|
|
|
|
|
|
run: mv */*.apk . ;rm -rf */ |
|
|
|
|
|
|
|
- name: Post to channel |
|
|
|
run: | |
|
|
|
run: | |
|
|
|
result=$(curl -s https://purge.jsdelivr.net/gh/${{ github.repository }}@test/) |
|
|
|
pip install pyTelegramBotAPI |
|
|
|
if echo $result |grep -q 'success.*true'; then |
|
|
|
path="$GITHUB_WORKSPACE/apk/" |
|
|
|
echo "jsdelivr缓存更新成功" |
|
|
|
python3 $GITHUB_WORKSPACE/.github/scripts/tg_bot.py "$BOT_TOKEN" "$CHANNEL_ID" "$path" |
|
|
|
else |
|
|
|
|
|
|
|
echo $result |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|