add required dependencies #261
Workflow file for this run
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: troppical-build | |
on: | |
push: | |
branches: [ "*" ] | |
pull_request: | |
types: [ opened, synchronize, reopened ] | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
Windows-build: | |
runs-on: windows-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Cache pip | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~\AppData\Local\pip\Cache | |
~\AppData\Local\pyinstaller\Cache | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
- name: Install dependencies | |
run: pip install pyqt6 pyinstaller pywin32 requests | |
- name: Build | |
shell: bash | |
run: | | |
pyinstaller --clean --onefile --icon=icon.ico --add-data "icon.ico;." --windowed main.py | |
pyinstaller --clean --onefile --icon=icon.ico --windowed init_troppical.py | |
env: | |
GITHUB_TOKEN: ${{ secrets.BUILD }} | |
- name: Upload troppical | |
uses: actions/upload-artifact@v4 | |
with: | |
name: troppical-windows | |
path: ${{ github.workspace }}/dist/main.exe | |
- name: Upload init_troppical | |
uses: actions/upload-artifact@v4 | |
with: | |
name: init-troppical-windows | |
path: ${{ github.workspace }}/dist/init_troppical.exe | |
Android-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Decode and save keystore | |
env: | |
ANDROID_KEYSTORE_B64: ${{ secrets.ANDROID_KEYSTORE_B64 }} | |
run: | | |
echo "$ANDROID_KEYSTORE_B64" | base64 --decode > ${{ github.workspace }}/android/app/ks.jks | |
- name: Check isPr | |
id: get_is_pr | |
run: | | |
is_pr=${{ github.event_name == 'pull_request' }} | |
echo "::set-output name=is_pr::$is_pr" | |
- name: Build with Gradle | |
run: | | |
cd android/ | |
chmod +x gradlew | |
./gradlew assembleRelease | |
cd ../.. | |
env: | |
ANDROID_KEYSTORE_FILE: ks.jks | |
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} | |
ANDROID_KEYSTORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASS }} | |
GITHUB_TOKEN: ${{ secrets.BUILD }} | |
IS_PR: ${{ steps.get_is_pr.outputs.is_pr }} | |
- name: Upload Android Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: troppical-android | |
path: ./android/app/build/outputs/apk/release/app-release.apk | |