Enhanced code #380
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: debug | |
on: | |
workflow_dispatch: | |
push: | |
paths-ignore: | |
- "docs/**" | |
- "README.md" | |
- "CHANGELOG.md" | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Get tags | |
id: get_tags | |
run: | | |
echo "tag=$(grep -oP 'version=\K[^ ]+' module.prop)" >> "$GITHUB_OUTPUT" | |
echo "version=$(git rev-parse --short HEAD)_$(date +%Y%m%d)" >> "$GITHUB_OUTPUT" | |
echo "versionCode=$(date +%Y%m%d)" >> "$GITHUB_OUTPUT" | |
- name: update module.prop | |
run: | | |
sed -i "s/${{ steps.get_tags.outputs.tag }}/&_${{ steps.get_tags.outputs.version }}_debug/g" module.prop | |
sed -i "s/versionCode=.*/versionCode=${{ steps.get_tags.outputs.versionCode }}/g" module.prop | |
- name: get version | |
id: get_version | |
run: | | |
echo "version=$(grep -oP 'version=\K[^ ]+' module.prop)" >> "$GITHUB_OUTPUT" | |
- name: Generate Asset | |
run: | | |
sudo mkdir -p /box_for_root | |
sudo cp -r --parents $(find ./ -type f ! -path './.git/*' ! -name 'CHANGELOG.md' ! -name 'update.json' ! -name 'build.sh' ! -path './.github/*' ! -path './docs/*') /box_for_root/ | |
- name: Upload Debug Asset => (box_for_magisk_${{ steps.get_version.outputs.version }}) | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "box_for_magisk_${{ steps.get_version.outputs.version }}" | |
path: /box_for_root/ | |
upload: | |
name: Telegram Upload Release | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Get tags | |
id: get_tags | |
run: | | |
echo "tag=$(grep -oP 'version=\K[^ ]+' module.prop)" >> "$GITHUB_OUTPUT" | |
echo "version=$(git rev-parse --short HEAD)_$(date +%Y%m%d)" >> "$GITHUB_OUTPUT" | |
echo "versionCode=$(date +%Y%m%d)" >> "$GITHUB_OUTPUT" | |
- name: Get Version and Build | |
run: | | |
sed -i "s/${{ steps.get_tags.outputs.tag }}/&_${{ steps.get_tags.outputs.version }}_debug/g" module.prop | |
sed -i "s/versionCode=.*/versionCode=${{ steps.get_tags.outputs.versionCode }}/g" module.prop | |
sh build.sh | |
- name: upload to telegram | |
if: ${{ success() }} | |
env: | |
CHAT_ID: "-1001597117128" | |
MESSAGE_THREAD_ID: "282263" | |
API_ID: ${{ secrets.API_ID }} | |
API_HASH: ${{ secrets.API_HASH }} | |
BOT_TOKEN: ${{ secrets.BOT_TOKEN }} | |
run: | | |
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then | |
export VERSION=${{ steps.get_tags.outputs.tag }}_${{ steps.get_tags.outputs.version }} | |
export COMMIT=$(git log --oneline -n 10 --no-decorate | sed 's/^[0-9a-f]* //' | sed 's/^/— /') | |
FILE=$(find -name "*.zip") | |
pip3 install telethon==1.31.1 | |
python3 $GITHUB_WORKSPACE/.github/taamarinbot.py $FILE | |
fi |