Skip to content

Commit

Permalink
Adding publishing github workflow (#10)
Browse files Browse the repository at this point in the history
* Adding publishing work to release workflow

* Adding publish workflow
  • Loading branch information
DariusIMP authored Oct 17, 2023
1 parent 3e0d300 commit 683a6e1
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 2 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Publish

on:
release:
types: [published]
schedule:
- cron: "0 1 * * 1-5"
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
publish_android_package:
name: Publish Android Package to Github Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3

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

- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r26
add-to-path: false
link-to-sdk: true

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
override: true
components: rustfmt, clippy

- name: Setup Rust toolchains
run: |
rustup target add armv7-linux-androideabi
rustup target add i686-linux-android
rustup target add aarch64-linux-android
rustup target add x86_64-linux-android
- name: Gradle Wrapper
run: |
gradle wrapper
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Gradle Publish Android Package
uses: gradle/gradle-build-action@v2
with:
arguments: publishAndroidReleasePublicationToGithubPackagesRepository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,3 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./zenoh-kotlin/build/dokka/html

15 changes: 14 additions & 1 deletion zenoh-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,22 @@ kotlin {
}
androidTarget {
publishLibraryVariants("release")
publishing {
repositories {
maven {
name = "GithubPackages"
url = uri("https://maven.pkg.github.com/eclipse-zenoh/zenoh-kotlin")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
}

@Suppress("Unused") sourceSets {
@Suppress("Unused")
sourceSets {
val commonMain by getting {
dependencies {
implementation("commons-net:commons-net:3.9.0")
Expand Down

0 comments on commit 683a6e1

Please sign in to comment.