Skip to content

Commit

Permalink
Added a very basic GitHub workflow for publishing of the library.
Browse files Browse the repository at this point in the history
  • Loading branch information
gerak-cz committed Apr 24, 2024
1 parent 52008b9 commit 142ac63
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish

on:
workflow_dispatch:
inputs:
major_version:
description: 'Major version'
required: true
type: number
minor_version:
description: 'Minor version'
required: true
type: number
patch_version:
description: 'Patch version'
required: true
type: number

jobs:
publish:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Checkout repository
run: echo "TEST=testicek" >> $GITHUB_ENV

- name: Publish to Maven
env:
MAJOR_VERSION: ${{ github.event.inputs.major_version }}
MINOR_VERSION: ${{ github.event.inputs.minor_version }}
PATCH_VERSION: ${{ github.event.inputs.patch_version }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_IN_MEMORY_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_IN_MEMORY_KEY_PASSWORD }}
run: ./gradlew publish
6 changes: 5 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ subprojects {
apply<DokkaPlugin>()
apply<MavenPublishPlugin>()

val majorVersion = System.getenv("MAJOR_VERSION") ?: "0"
val minorVersion = System.getenv("MINOR_VERSION") ?: "1"
val patchVersion = System.getenv("PATCH_VERSION") ?: "0"

group = "io.github.cleverlance.linguine"
version = "0.1.0"
version = "$majorVersion.$minorVersion.$patchVersion"

mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
Expand Down

0 comments on commit 142ac63

Please sign in to comment.