Skip to content

Commit

Permalink
test github packages release
Browse files Browse the repository at this point in the history
  • Loading branch information
Siedlerchr committed Nov 1, 2023
1 parent dc172e7 commit 0a1c8a4
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 76 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,8 @@ jobs:
- name: Release Snapshots
if: github.ref == 'refs/heads/master'
run: |
./gradlew publish -PsonatypeUsername=$SONATYPE_USERNAME -PsonatypePassword=$SONATYPE_PASSWORD -Ptransifex.api=$TRANSIFEX_API
./gradlew publishAllPublicationsToGitHubPackagesRepository
shell: bash
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
TRANSIFEX_API: ${{ secrets.TRANSIFEX_API }}

- name: Draft release
if: github.ref == 'refs/heads/master'
Expand Down
25 changes: 2 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,33 +40,12 @@ jobs:
Xvfb -ac :90 -screen 0 1280x1024x24 > /dev/null 2>&1 &
./gradlew build test
- name: Release to Maven Central
- name: Release to GithubPackages
id: deploy
run: |
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -i \
-PsonatypeUsername=$SONATYPE_USERNAME -PsonatypePassword=$SONATYPE_PASSWORD -Ptransifex.api=$TRANSIFEX_API \
-Psigning.keyId=$GPG_KEYNAME -Psigning.password=$GPG_PASSPHRASE -Psigning.secretKeyRingFile=$HOME/.gnupg/secring.gpg \
-Dorg.gradle.internal.publish.checksums.insecure=true
./gradlew publishAllPublicationsToGitHubPackagesRepository
echo ::set-output name=exit_code::$?
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
TRANSIFEX_API: ${{ secrets.TRANSIFEX_API }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }}
- name: Commit next development version
if: steps.deploy.outputs.exit_code == 0
run: |
git config --global user.name "abhinayagarwal"
git config --global user.email "abhinay_agarwal@live.com"
TAG=${GITHUB_REF/refs\/tags\//}
newVersion=${TAG%.*}.$((${TAG##*.} + 1)) # Update version by 1
sed -i "0,/^controlsfx_version = $TAG/s//controlsfx_version = $newVersion-SNAPSHOT/" gradle.properties
git commit gradle.properties -m "Prepare development of $newVersion"
git push https://abhinayagarwal:$PAT@github.com/$GITHUB_REPOSITORY HEAD:master
env:
PAT: ${{ secrets.PAT }}
- name: Update Javadocs
if: steps.deploy.outputs.exit_code == 0
Expand Down
10 changes: 6 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ subprojects {
}
}

task sourceJar(type: Jar) {
tasks.register('sourceJar', Jar) {
from sourceSets.main.java
from sourceSets.main.resources
archiveClassifier.set('sources')
}

task javadocJar(type: Jar) {
tasks.register('javadocJar', Jar) {
dependsOn javadoc
from javadoc.destinationDir
archiveClassifier.set('javadoc')
Expand All @@ -69,8 +69,10 @@ subprojects {
}

// Do not publish Gradle modules
tasks.withType(GenerateModuleMetadata) {
enabled = false
tasks.withType(GenerateModuleMetadata).tap {
configureEach {
enabled = false
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
group = org.controlsfx
group = org.controlsfxjabref
controlsfx_version = 11.1.3-SNAPSHOT
fxsampler_version = 1.0.12-SNAPSHOT
javafx_version = 17
98 changes: 55 additions & 43 deletions mavenPublish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,69 @@ signing {
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
afterEvaluate {
artifact sourceJar
artifact javadocJar

repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/jabref/controlsfx"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}

versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
publications {
mavenJava(MavenPublication) {
from components.java
afterEvaluate {
artifact sourceJar
artifact javadocJar
}
}

pom {
name = 'ControlsFX'
description = 'High quality UI controls and other tools to complement the core JavaFX distribution'
url = 'http://www.controlsfx.org/'
licenses {
license {
name = 'The 3-Clause BSD License'
url = 'http://www.opensource.org/licenses/bsd-license.php'
distribution = 'repo'
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
}
developers {
developer {
name = 'Jonathan Giles'
email = 'jonathan@jonathangiles.net'
roles = [
'author',
'developer'
]
usage('java-runtime') {
fromResolutionResult()
}
}
scm {
connection = 'scm:git:https://github.com/controlsfx/controlsfx'
developerConnection = 'scm:git:ssh://hg@github.com/controlsfx/controlsfx'
url = 'https://github.com/controlsfx/controlsfx'
}

// Remove classifier for JavaFX dependencies
withXml {
Node pomNode = asNode()
pomNode.dependencies.'*'.findAll() {
it.groupId.text() == 'org.openjfx'
}.each {
it.parent().remove(it)
pom {
name = 'ControlsFX'
description = 'High quality UI controls and other tools to complement the core JavaFX distribution'
url = 'http://www.controlsfx.org/'
licenses {
license {
name = 'The 3-Clause BSD License'
url = 'http://www.opensource.org/licenses/bsd-license.php'
distribution = 'repo'
}
}
developers {
developer {
name = 'Jonathan Giles'
email = 'jonathan@jonathangiles.net'
roles = [
'author',
'developer'
]
}
}
scm {
connection = 'scm:git:https://github.com/jabref/controlsfx'
developerConnection = 'scm:git:ssh://hg@github.com/jabref/controlsfx'
url = 'https://github.com/jabref/controlsfx'
}

// Remove classifier for JavaFX dependencies
withXml {
Node pomNode = asNode()
pomNode.dependencies.'*'.findAll() {
it.groupId.text() == 'org.openjfx'
}.each {
it.parent().remove(it)
}
}
}
}
Expand Down

0 comments on commit 0a1c8a4

Please sign in to comment.