Skip to content

Commit

Permalink
chore: update build file
Browse files Browse the repository at this point in the history
  • Loading branch information
mohnoor94 committed Sep 12, 2024
1 parent 8425872 commit 9836958
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 71 deletions.
33 changes: 1 addition & 32 deletions .github/workflows/release-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ name: Release SDK to Maven Central

on:
workflow_dispatch:
# inputs:
# version:
# description: |
# The version to release.
# Add -SNAPSHOT to release a snapshot version.
# default: '0.0.1-SNAPSHOT'

jobs:
release-sdk:
Expand All @@ -18,37 +12,12 @@ jobs:

- uses: actions/setup-java@v4
with:
java-version: 11
java-version: 21
distribution: 'temurin'
server-id: oss-sonatype
server-username: SONATYPE_USERNAME
server-password: SONATYPE_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}

# - name: Prepare Environment and Version
# id: prepare
# run: |
# git config user.name s-github-actions
# git config user.email [email protected]
# echo "branch_name=release/${{ inputs.version }}" >> $GITHUB_OUTPUT

# - name: Prepare Release
# id: prepare_release
# run: |
# cd code
# gradle --no-daemon versionsSet -Pversion=${{ inputs.version }}
#
# - name: Create PR
# uses: peter-evans/create-pull-request@v7
# with:
# branch: "publish-v${{ inputs.version }}"
# commit-message: "chore: prepare release ${{ inputs.version }}"
# title: "chore: Publish v${{ inputs.version }}"
# body: |
# This PR updates the version of the SDK to v`${{ inputs.version }}`.
# Generated by the EG SDK generator.
# add-paths: |
# code/*

- name: Publish
env:
Expand Down
75 changes: 36 additions & 39 deletions code/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import org.jetbrains.dokka.gradle.DokkaTask

\


buildscript {
repositories {
mavenCentral {
url = uri("https://repo.maven.apache.org/maven2")
credentials {
username = System.getenv("SONATYPE_USERNAME") ?: findProperty('ARTIFACTORY_USER')
password = System.getenv("SONATYPE_PASSWORD") ?: findProperty('ARTIFACTORY_PASS')
}
}
}
}
//buildscript {
// repositories {
// mavenCentral {
// url = uri("https://repo.maven.apache.org/maven2")
// credentials {
// username = System.getenv("SONATYPE_USERNAME") ?: findProperty('ARTIFACTORY_USER')
// password = System.getenv("SONATYPE_PASSWORD") ?: findProperty('ARTIFACTORY_PASS')
// }
// }
// }
//}

plugins {
id 'org.jetbrains.kotlin.jvm' version '1.9.22'
Expand All @@ -30,10 +27,10 @@ version = "0.0.1-SNAPSHOT"
repositories {
mavenCentral {
url = uri("https://repo.maven.apache.org/maven2")
credentials {
username = System.getenv("SONATYPE_USERNAME") ?: findProperty('ARTIFACTORY_USER')
password = System.getenv("SONATYPE_PASSWORD") ?: findProperty('ARTIFACTORY_PASS')
}
// credentials {
// username = System.getenv("SONATYPE_USERNAME") ?: findProperty('ARTIFACTORY_USER')
// password = System.getenv("SONATYPE_PASSWORD") ?: findProperty('ARTIFACTORY_PASS')
// }
}
}

Expand Down Expand Up @@ -69,15 +66,15 @@ java {
targetCompatibility = JavaVersion.VERSION_11
}

subprojects {
afterEvaluate { project ->
if (project.name == System.getenv('EXCLUDE_MODULE')) {
// Disable all tasks for this module
tasks.configureEach { task -> task.enabled = false
}
}
}
}
//subprojects {
// afterEvaluate { project ->
// if (project.name == System.getenv('EXCLUDE_MODULE')) {
// // Disable all tasks for this module
// tasks.configureEach { task -> task.enabled = false
// }
// }
// }
//}

publishing {
publications {
Expand Down Expand Up @@ -132,18 +129,18 @@ publishing {

}

tasks.register('versionsSet') {
doLast {
def pattern = ~/(\R|^)(version\s*=\s*)([-.A-Z0-9]+)(\R|$)/
String gradleProperties = file('gradle.properties').text
String currentVersion = (gradleProperties =~ pattern)[0][3]
println("Current version: $currentVersion")
println("Project version: ${project.version}")
if (project.version != currentVersion) {
file('gradle.properties').text = gradleProperties.replaceFirst(pattern, "\$1\$2${project.version}\$4")
}
}
}
//tasks.register('versionsSet') {
// doLast {
// def pattern = ~/(\R|^)(version\s*=\s*)([-.A-Z0-9]+)(\R|$)/
// String gradleProperties = file('gradle.properties').text
// String currentVersion = (gradleProperties =~ pattern)[0][3]
// println("Current version: $currentVersion")
// println("Project version: ${project.version}")
// if (project.version != currentVersion) {
// file('gradle.properties').text = gradleProperties.replaceFirst(pattern, "\$1\$2${project.version}\$4")
// }
// }
//}

tasks.withType(DokkaTask.class) {

Expand Down

0 comments on commit 9836958

Please sign in to comment.