This repository has been archived by the owner on Jul 27, 2024. It is now read-only.
Update Dockerfile #81
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: Ubuntu | |
on: | |
push: | |
pull_request: | |
jobs: | |
test: | |
name: Test on Python ${{ matrix.python-version }} and ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [ 3.7, 3.8, 3.9, '3.10', '3.11' ] | |
os: [ ubuntu-latest ] | |
env: | |
APKTOOL_VERSION: 2.7.0 | |
BUILD_TOOLS_VERSION: 33.0.0 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Python packages | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r ./src/requirements.txt | |
- name: Install dependencies | |
run: | | |
# Install Apktool. | |
sudo wget -q https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool -O /usr/local/bin/apktool | |
sudo chmod a+x /usr/local/bin/apktool | |
sudo wget -q "https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_${APKTOOL_VERSION}.jar" -O /usr/local/bin/apktool.jar | |
sudo chmod a+x /usr/local/bin/apktool.jar | |
# Install BundleDecompiler. | |
sudo wget -q https://raw.githubusercontent.com/TamilanPeriyasamy/BundleDecompiler/master/build/libs/BundleDecompiler-0.0.2.jar -O /usr/local/bin/BundleDecompiler.jar | |
sudo chmod a+x /usr/local/bin/BundleDecompiler.jar | |
- name: Run tests | |
run: | | |
export PATH="${PATH}:${ANDROID_HOME}/build-tools/${BUILD_TOOLS_VERSION}" | |
pytest --verbose --cov=./ --cov-report xml | |
- name: Upload tests coverage to Codacy | |
if: contains(github.event_name, 'pull_request') == false | |
env: | |
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
run: | | |
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -l Python -r ./coverage.xml | |
- name: Upload tests coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
fail_ci_if_error: false | |
publish: | |
# Run only if the previous job succeeds (only master branch or new tags, no pull requests). | |
if: (endsWith(github.ref, '/master') || startsWith(github.ref, 'refs/tags/v')) && contains(github.event_name, 'pull_request') == false | |
needs: test | |
name: Push updated version to Docker Hub | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: claudiugeorgiu | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: claudiugeorgiu/obfuscapk | |
tags: | | |
type=raw,value=latest | |
type=semver,pattern={{version}} | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
context: ./src/ | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} |