mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-02-07 14:22:39 -05:00
chore(ci): Remove GitHub Packages publishing workflow (#4368)
This commit is contained in:
36
.github/workflows/publish-packages.yml
vendored
36
.github/workflows/publish-packages.yml
vendored
@@ -1,36 +0,0 @@
|
||||
name: Publish Packages
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
java-version: '21'
|
||||
distribution: 'jetbrains'
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v5
|
||||
with:
|
||||
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
|
||||
|
||||
- name: Publish to GitHub Packages
|
||||
run: ./gradlew :core:api:publish :core:model:publish :core:proto:publish
|
||||
env:
|
||||
GITHUB_ACTOR: ${{ github.actor }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -14,19 +14,19 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import java.io.FileInputStream
|
||||
import java.util.Properties
|
||||
|
||||
project.pluginManager.apply("maven-publish")
|
||||
|
||||
val configProperties = Properties()
|
||||
val configFile = rootProject.file("config.properties")
|
||||
if (configFile.exists()) {
|
||||
FileInputStream(configFile).use { configProperties.load(it) }
|
||||
}
|
||||
|
||||
val versionBase = configProperties.getProperty("VERSION_NAME_BASE") ?: "0.0.0-SNAPSHOT"
|
||||
val appVersion = System.getenv("VERSION_NAME") ?: versionBase
|
||||
|
||||
project.version = appVersion
|
||||
project.group = "org.meshtastic"
|
||||
|
||||
if (project.version == "unspecified") {
|
||||
val props = Properties().apply {
|
||||
rootProject.file("config.properties").takeIf { it.exists() }?.inputStream()?.use { load(it) }
|
||||
}
|
||||
|
||||
project.version = System.getenv("VERSION")
|
||||
?: System.getenv("VERSION_NAME")
|
||||
?: props.getProperty("VERSION_NAME_BASE")
|
||||
?: "0.0.0-SNAPSHOT"
|
||||
}
|
||||
|
||||
@@ -36,12 +36,10 @@ configure<ApplicationExtension> {
|
||||
testOptions { unitTests.isReturnDefaultValues = true }
|
||||
}
|
||||
|
||||
val meshtasticVersion = "main-SNAPSHOT"
|
||||
|
||||
dependencies {
|
||||
implementation("com.github.meshtastic.Meshtastic-Android:core-api:$meshtasticVersion")
|
||||
implementation("com.github.meshtastic.Meshtastic-Android:core-model:$meshtasticVersion")
|
||||
implementation("com.github.meshtastic.Meshtastic-Android:core-proto:$meshtasticVersion")
|
||||
implementation(projects.core.api)
|
||||
implementation(projects.core.model)
|
||||
implementation(projects.core.proto)
|
||||
|
||||
implementation(libs.androidx.activity.compose)
|
||||
implementation(libs.androidx.lifecycle.viewmodel.compose)
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
<uses-permission android:name="com.geeksville.mesh.permission.BIND_MESH_SERVICE" />
|
||||
<queries>
|
||||
<package android:name="com.geeksville.mesh" />
|
||||
<package android:name="com.geeksville.mesh.google.debug" />
|
||||
<package android:name="com.geeksville.mesh.fdroid.debug" />
|
||||
</queries>
|
||||
|
||||
<application
|
||||
|
||||
@@ -22,6 +22,7 @@ import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.content.ServiceConnection
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.os.IBinder
|
||||
@@ -102,13 +103,32 @@ class MainActivity : ComponentActivity() {
|
||||
try {
|
||||
Log.i(TAG, "Attempting to bind to Mesh Service...")
|
||||
val intent = Intent("com.geeksville.mesh.Service")
|
||||
intent.setClassName("com.geeksville.mesh", "com.geeksville.mesh.service.MeshService")
|
||||
|
||||
// Query the package manager to find an app that handles this service action.
|
||||
// This is more resilient than hardcoding a package name, which might change with flavors.
|
||||
val resolveInfo =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
packageManager.queryIntentServices(intent, PackageManager.ResolveInfoFlags.of(0))
|
||||
} else {
|
||||
@Suppress("DEPRECATION")
|
||||
packageManager.queryIntentServices(intent, 0)
|
||||
}
|
||||
|
||||
if (resolveInfo.isNotEmpty()) {
|
||||
val serviceInfo = resolveInfo[0].serviceInfo
|
||||
intent.setClassName(serviceInfo.packageName, serviceInfo.name)
|
||||
Log.i(TAG, "Found service in package: ${serviceInfo.packageName}")
|
||||
} else {
|
||||
Log.w(TAG, "No service found for action com.geeksville.mesh.Service. Falling back to default.")
|
||||
intent.setClassName("com.geeksville.mesh", "com.geeksville.mesh.service.MeshService")
|
||||
}
|
||||
|
||||
val success = bindService(intent, serviceConnection, BIND_AUTO_CREATE)
|
||||
if (!success) {
|
||||
Log.e(TAG, "bindService returned false")
|
||||
}
|
||||
} catch (e: SecurityException) {
|
||||
Log.e(TAG, "SecurityException while binding", e)
|
||||
Log.e(TAG, "SecurityException while binding: ${e.message}")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user