Skip to content

Commit

Permalink
Merge pull request #3 from ZeroGachis/SORD-532/with-soti-in-stage-apk…
Browse files Browse the repository at this point in the history
…-is-automatically-updated

✨ SORD-532 auto update apk on push to soti
  • Loading branch information
ulricden authored Aug 1, 2024
2 parents 85e4462 + da29c70 commit ca7169d
Show file tree
Hide file tree
Showing 9 changed files with 595 additions and 93 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Run Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install -r requirements.txt
- name: Run tests
run: pytest
135 changes: 135 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyderworkspace

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,31 @@

**Required** 'Soti password'

### `auto-update`:

**Optional** _boolean -> default false_ 'auto update apk version on profile and install it on device link'

### `soti-profile-id`:

**Optional Required if `auto-update` is true** 'soti profile name'

### `package-name`:

**Optional Required if `auto-update` is true** 'package name'

## Example usage

```yaml
uses: ZeroGachis/github-action-soti-apk-uploader@main
with:
soti-api-url: 'Soti api url'
apk-path: 'Apk path'
soti-api-key: 'Soti api key'
soti-api-secret: 'Soti api secret'
soti-username: 'Soti username'
soti-password: 'Soti password'
soti-api-url: "Soti api url"
apk-path: "Apk path"
soti-api-key: "Soti api key"
soti-api-secret: "Soti api secret"
soti-username: "Soti username"
soti-password: "Soti password"
//optional
auto-update: true
soti-profile-id: "Soti profile id"
package-name: "Package name"
```
33 changes: 23 additions & 10 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,44 @@
name: 'Github Action Soti Apk Uploader'
description: 'a Github Action to push an Apk on Soti'
name: "Github Action Soti Apk Uploader"
description: "a Github Action to push an Apk on Soti"
inputs:
soti-api-url:
description: 'Soti api url'
description: "Soti api url"
required: true
apk-path:
description: 'apk path'
description: "apk path"
required: true
soti-api-key:
description: 'Soti api key'
description: "Soti api key"
required: true
soti-api-secret:
description: 'Soti api secret'
description: "Soti api secret"
required: true
soti-username:
description: 'Soti username'
description: "Soti username"
required: true
soti-password:
description: 'Soti password'
description: "Soti password"
required: true
auto-update:
description: "auto update"
default: "false"
required: false
soti-profile-id:
description: "Soti profile id"
required: false
package-name:
description: "Package name"
required: false
runs:
using: 'docker'
image: 'Dockerfile'
using: "docker"
image: "Dockerfile"
args:
- ${{ inputs.soti-api-url }}
- ${{ inputs.apk-path }}
- ${{ inputs.soti-api-key }}
- ${{ inputs.soti-api-secret }}
- ${{ inputs.soti-username }}
- ${{ inputs.soti-password }}
- ${{ inputs.auto-update }}
- ${{ inputs.soti-profile-id }}
- ${{ inputs.package-name }}
6 changes: 5 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/sh -l

python /upload_package.py $1 /github/workspace/$2 $3 $4 $5 $6
if [ "$7" = "true" ]; then
python /upload_package.py $1 /github/workspace/$2 $3 $4 $5 $6 --auto-update --profile-name "$8" --package-name "$9"
else
python /upload_package.py $1 /github/workspace/$2 $3 $4 $5 $6
fi
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
requests==2.32.3
urllib3==2.2.2
Loading

0 comments on commit ca7169d

Please sign in to comment.