Skip to content

Commit 854d348

Browse files
Automate GitHub Releases for PyPI and Android
1 parent 2306059 commit 854d348

2 files changed

Lines changed: 44 additions & 3 deletions

File tree

.github/workflows/pypi-publish.yml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish Python 🐍 distribution 📦 to PyPI
1+
name: Build and Publish GuGa (PyPI + Android)
22

33
on:
44
release:
@@ -9,7 +9,7 @@ permissions:
99
contents: read
1010

1111
jobs:
12-
build-and-publish:
12+
build-and-publish-pypi:
1313
name: Build and publish Python 🐍 distribution 📦 to PyPI
1414
runs-on: ubuntu-latest
1515
permissions:
@@ -35,3 +35,40 @@ jobs:
3535
uses: pypa/gh-action-pypi-publish@release/v1
3636
with:
3737
packages-dir: server/dist/
38+
39+
build-and-upload-android:
40+
name: Build Android APK 📱
41+
runs-on: ubuntu-latest
42+
permissions:
43+
contents: write # IMPORTANT: Required to upload files to GitHub Releases!
44+
45+
steps:
46+
- name: Checkout Source Code
47+
uses: actions/checkout@v4
48+
49+
- name: Set up JDK 17
50+
uses: actions/setup-java@v4
51+
with:
52+
java-version: '17'
53+
distribution: 'temurin'
54+
cache: gradle
55+
56+
- name: Make gradlew executable
57+
run: chmod +x ./gradlew
58+
working-directory: app-stable
59+
60+
- name: Build APK
61+
# We build assembleDebug here so it is natively signed with the default debug key
62+
# and ready for immediate sideloading without throwing Android "unsigned" errors!
63+
run: ./gradlew assembleDebug
64+
working-directory: app-stable
65+
66+
- name: Rename APK
67+
run: mv app-stable/app/build/outputs/apk/debug/app-debug.apk app-stable/app/build/outputs/apk/debug/guga-stable.apk
68+
69+
- name: Upload APK to GitHub Release
70+
# Only explicitly upload it to the release if a release triggered this run
71+
if: github.event_name == 'release'
72+
uses: softprops/action-gh-release@v2
73+
with:
74+
files: app-stable/app/build/outputs/apk/debug/guga-stable.apk

server/pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "GuGa"
7-
version = "1.0.3"
7+
version = "1.0.5"
88
description = "Linux to Android notification bridge."
99
readme = "README.md"
1010
requires-python = ">=3.7"
@@ -21,3 +21,7 @@ dependencies = [
2121

2222
[project.scripts]
2323
guga = "guga.cli:main"
24+
25+
[project.urls]
26+
"Homepage" = "https://github.com/PositiveMatician/GuGa-Nexus"
27+
"Repository" = "https://github.com/PositiveMatician/GuGa-Nexus"

0 commit comments

Comments
 (0)