remove unused

This commit is contained in:
taamarin
2023-07-29 00:09:21 +07:00
parent 6c269ac73f
commit 6cc3d0cc8a
4 changed files with 181 additions and 142 deletions

View File

@@ -47,53 +47,38 @@ jobs:
upload:
name: Telegram Upload Release
runs-on: ubuntu-latest
if: ${{ startsWith(github.event.head_commit.message, '[telUp]') }}
needs: [build]
steps:
- uses: actions/checkout@v3
- name: Get tags
id: get_tags
run: |
echo "tag=$(grep -oP 'version=\K[^ ]+' module.prop)" >> "$GITHUB_OUTPUT"
echo "date=$(date +%Y%m%d_%H%M)" >> "$GITHUB_OUTPUT"
- name: Get Version and Build
run: |
sed -i "s/${{ steps.get_tags.outputs.tags }}/&_$(date +%Y%m%d_%H%M)_debug/g" module.prop
sed -i "s/${{ steps.get_tags.outputs.tag }}/&_$(date +%Y%m%d_%H%M)_debug/g" module.prop
sh build.sh
- name: Release
run: |
mkdir bfr
find -name "*.zip" -exec cp {} bfr \;
function upload() {
for file in $@; do
echo ">> Uploading $file"
curl https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendDocument \
-X POST \
-F chat_id="${{ secrets.TELEGRAM_TO }}" \
-F document="@$file" \
--silent --show-error --fail >/dev/null &
done
for job in $(jobs -p); do
wait $job || exit 1
done
}
upload bfr/*
commit:
name: Commit GitHub
runs-on: ubuntu-latest
if: ${{ startsWith(github.event.head_commit.message, '[telUp]') }}
needs: [build]
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: get commit url
id: commit_url
- name: Upload to telegram
env:
CHAT_ID: ${{ secrets.CHAT_ID }}
CACHE_CHAT_ID: ${{ secrets.CACHE_CHAT_ID }}
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
MESSAGE_THREAD_ID: ${{ secrets.MESSAGE_THREAD_ID }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
COMMIT_URL: ${{ github.event.head_commit.url }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
TITLE: BFM/R ${{ steps.get_tags.outputs.tag }}_${{ steps.get_tags.outputs.date }}_debug
run: |
echo "::set-output name=commit::$(git log -1 --pretty=format:%s)"
- name: send commit to telegram
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: "${{ steps.commit_url.outputs.commit }}"
export VERSION=$(date +%m%d)
FILE=$(find ./bfr/* -type f)
pip3 install python-telegram-bot
python3 docs/tubot.py $FILE