Skip to content

Commit

Permalink
GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
philips77 committed Mar 8, 2024
1 parent ae991b4 commit f211701
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/deploy-to-nexus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy to Nexus
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
deployToNexus:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '17'
- shell: bash
env:
# The following env variables are used by gradle/publish-module.gradle
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
# The following env variables are used by gradle/publish-root.gradle.kts
OSSR_USERNAME: ${{ secrets.OSSR_USERNAME }}
OSSR_PASSWORD: ${{ secrets.OSSR_PASSWORD }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
# The script generates sec.gpg file that is required by gradle/publish-module.gradle
# and starts :deployNexus lane using fastlane.
run: |
java --version
echo "${{ secrets.GPG_FILE }}" > sec.gpg.asc
gpg -d --passphrase "${{ secrets.GPG_FILE_PSWD }}" --batch sec.gpg.asc > sec.gpg
fastlane deployNexus
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source 'https://rubygems.org'

gem 'fastlane'
9 changes: 9 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.dokka)
}

subprojects {
apply(plugin = "org.jetbrains.dokka")
}

tasks.dokkaHtmlMultiModule.configure {
outputDirectory.set(rootDir.resolve("docs"))
}
30 changes: 30 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:android)

platform :android do

desc "Deploy libraries to Nexus."
lane :deployNexus do
gradle(task: "publish")
# gradle(task: "releaseStagingRepositories")
end

desc "Generate docs."
lane :generateDocs do
gradle(task: "dokkaHtmlMultiModule")
end
end
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
kotlin = "1.9.23"

nordicPlugins = "2.0.0"
dokkaPlugin = "1.9.20"

[libraries]
kotlin-junit = { group = "org.jetbrains.kotlin", name = "kotlin-test-junit", version.ref = "kotlin" }

[plugins]
nordic-nexus-kotlin = { id = "no.nordicsemi.kotlin.gradle.nexus", version.ref = "nordicPlugins" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-dokka = { id = "org.jetbrains.dokka", version.ref = "dokkaPlugin" }

0 comments on commit f211701

Please sign in to comment.