👷 Reuse workflows

This commit is contained in:
Nikhil Badyal
2022-10-15 14:43:20 +05:30
parent 7e80b3007d
commit d792cab58f
8 changed files with 23 additions and 99 deletions
+8 -3
View File
@@ -67,16 +67,20 @@ jobs:
sleep 10
virustotal-scan:
if: ${{ inputs.SKIP_VIRUSTOTAL_SCAN }}
needs: [ upload-to-github ]
uses: ./.github/workflows/virus-total-scan.yml
uses: nikhilbadyal/ghactions/.github/workflows/virustotal-scan.yml@main
with:
FILES: |
.apk$
request_rate: 4
if: ${{ inputs.SKIP_VIRUSTOTAL_SCAN }}
secrets:
VT_API_KEY: ${{ secrets.VT_API_KEY }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
upload-to-telegram:
needs: [ build-apk ]
uses: ./.github/workflows/telegram-uploader.yml
uses: nikhilbadyal/ghactions/.github/workflows/telegram-uploader.yml@main
secrets:
TELEGRAM_API_ID: ${{ secrets.TELEGRAM_API_ID }}
TELEGRAM_API_HASH: ${{ secrets.TELEGRAM_API_HASH }}
@@ -85,6 +89,7 @@ jobs:
STICKER_ID: ${{ secrets.STICKER_ID }}
CHANGELOG_GITHUB_REPOSITORY: ${{ secrets.CHANGELOG_GITHUB_REPOSITORY }}
cleanup:
name: GitHub Cleanup
if: ${{ inputs.CLEANUP }}
+6
View File
@@ -18,3 +18,9 @@ jobs:
with:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
RELEASE_PATTERN: '[\s\S]*'
- name: Delete Workflow Runs
uses: nikhilbadyal/ghactions/.github/workflows/github-workflow-cleaner.yml@main
with:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
-29
View File
@@ -1,29 +0,0 @@
name: Linter
env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
on:
workflow_call:
workflow_dispatch:
jobs:
linter:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
- name: Setup Python
uses: actions/setup-python@v4.3.0
with:
python-version: "3.10"
cache: pip
cache-dependency-path: |
requirements.txt
- name: Run pre-commit
uses: pre-commit/action@v3.0.0
+3 -1
View File
@@ -9,7 +9,9 @@ on:
jobs:
linter-pr-check:
uses: ./.github/workflows/linter.yml
uses: nikhilbadyal/ghactions/.github/workflows/python-linter.yml@main
with:
PYTHON_VERSION: '3.10'
build-apk-pr-check:
uses: ./.github/workflows/build-artifact.yml
secrets:
+5 -26
View File
@@ -10,30 +10,9 @@ permissions:
jobs:
auto-update:
timeout-minutes: 5
uses: nikhilbadyal/ghactions/.github/workflows/python-precommit-updater.yml@main
if: github.repository == 'nikhilbadyal/docker-py-revanced'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
- name: Setup Python
uses: actions/setup-python@v4.3.0
with:
python-version: '3.x'
- name: Install pre-commit
run: pip install pre-commit
- name: Updated Hooks
run: pre-commit autoupdate
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4.1.3
with:
token: ${{ secrets.GH_TOKEN }}
branch: update/pre-commit-autoupdate
title: ⬆️Update pre-commit hooks
commit-message: ⬆️updated pre-commit hooks
body: ✨Update versions of tools in pre-commit configs to latest version
labels: pre-commit✨
secrets:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
with:
PYTHON_VERSION: '3.10'
@@ -31,7 +31,7 @@ on:
jobs:
tg-upload:
uses: ./.github/workflows/telegram-uploader.yml
uses: nikhilbadyal/ghactions/.github/workflows/telegram-uploader.yml@main
secrets:
TELEGRAM_API_ID: ${{ inputs.API_ID }}
TELEGRAM_API_HASH: ${{ inputs.API_HASH }}
-37
View File
@@ -1,37 +0,0 @@
name: Telegram Upload
on:
workflow_dispatch:
workflow_call:
secrets:
TELEGRAM_API_ID:
required: true
TELEGRAM_API_HASH:
required: true
TELEGRAM_BOT_TOKEN:
required: true
TELEGRAM_CHAT_ID:
required: true
STICKER_ID:
required: true
CHANGELOG_GITHUB_REPOSITORY:
required: false
jobs:
tg-upload:
name: Telegram Upload
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Upload to Telegram
if: ${{ env.HAVE_TELEGRAM_API_ID == 'true' }}
uses: nikhilbadyal/ghaction-telegram-uploader@main
with:
API_ID: ${{ secrets.TELEGRAM_API_ID }}
API_HASH: ${{ secrets.TELEGRAM_API_HASH }}
BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
STICKER_ID: ${{ secrets.STICKER_ID }}
CHANGELOG_GITHUB_REPOSITORY: ${{ secrets.CHANGELOG_GITHUB_REPOSITORY }}
env:
HAVE_TELEGRAM_API_ID: ${{ secrets.TELEGRAM_API_ID != '' }}