Skip to content

Commit

Permalink
feature: Publish Kuksa SDK Snapshot Builds to GitHub Packages
Browse files Browse the repository at this point in the history
Closes: eclipse-kuksa#6
Signed-Off-By: Andre Weber <[email protected]>
  • Loading branch information
wba2hi committed Sep 13, 2023
1 parent 4fd6c30 commit efda1a2
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: deployment

concurrency: production

on:
push
# branches:
# - main

jobs:
deployment:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Publish Library
run: ./gradlew publishReleasePublicationToGithubPackagesRepository
-Pgpr.repository=${{ github.repository }}
-Pgpr.user=${{ github.actor }}
-Pgpr.token=${{ secrets.GITHUB_TOKEN }}
51 changes: 51 additions & 0 deletions buildSrc/src/main/kotlin/publish.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright (c) 2023 Contributors to the Eclipse Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
*
*/

plugins {
`maven-publish`
}

afterEvaluate {
publishing {
repositories {
maven {
name = "LocalFolder"
url = uri("${buildDir}/artifactory")
}

maven {
name = "GithubPackages"

val repository = project.findProperty("gpr.repository") as String? ?: System.getenv("GPR_REPOSITORY")
url = uri("https://maven.pkg.github.com/$repository")

credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("GPR_USERNAME")
password = project.findProperty("gpr.token") as String? ?: System.getenv("GPR_TOKEN")
}
}
}
publications {
register<MavenPublication>("release") {
from(components["release"])
}
}
}

}
6 changes: 5 additions & 1 deletion kuksa-sdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ plugins {
id("org.jetbrains.kotlin.android")

id("com.google.protobuf")
publish
}

group = "org.eclipse.kuksa"
version = "0.1.0-SNAPSHOT"

android {
namespace = "com.etas.kuksa.sdk"
namespace = "org.eclipse.kuksa"
compileSdk = 33

defaultConfig {
Expand Down
7 changes: 7 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ pluginManagement {
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
maven {
url = uri("https://maven.pkg.github.com/boschglobal/kuksa-android-sdk")
credentials {
username = System.getenv("GPR_USER")
password = System.getenv("GPR_TOKEN")
}
}
google()
mavenCentral()
}
Expand Down

0 comments on commit efda1a2

Please sign in to comment.