add task.kt #256
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*" ] | |
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: Build with Gradle | |
run: | | |
cd android/ | |
chmod +x gradlew | |
./gradlew assembleDebug | |
cd ../.. | |
- name: Upload Android Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: app-debug | |
path: ./android/app/build/outputs/apk/debug/app-debug.apk |