fix #166
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: [ "*" ] | |
tags: [ "v*" ] | |
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: Bump version | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
$NEW_VERSION="${{ github.ref_name }}" | |
(Get-Content troppical.py) -replace 'version = ".*"', "version = `"$NEW_VERSION`"" | Set-Content troppical.py | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add troppical.py | |
git commit -m "Update version to $NEW_VERSION" | |
git push origin HEAD:master --force --follow-tags --verbose | |
shell: pwsh | |
- 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: | | |
mkdir -p ${{ github.workspace }}/bin | |
pyinstaller --clean --onefile --icon=icon.ico --add-data "icon.ico;." --windowed troppical.py | |
- name: Upload troppical | |
uses: actions/upload-artifact@v4 | |
with: | |
name: troppical-nightly | |
path: ${{ github.workspace }}/dist/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: 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 }} | |
- name: Upload Android Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: app-release | |
path: ./android/app/build/outputs/apk/release/app-release.apk |