Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Build and release version
on:
workflow_dispatch:
inputs:
tagName:
required: true
description: 'TAG name for release'
targetBranch:
description: 'Branch to build'
required: true
releaseVersion:
description: 'Release version'
required: true
nextDevVersion:
description: 'Next development version'
required: true
releaseMessage:
required: true
description: 'Release message'
jobs:
build:
runs-on: macos-15
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_ARGS: -Dmaven.resolver.transport=wagon
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
RELEASE_VERSION: ${{ github.event.inputs.releaseVersion }}
NEXT_DEVELOPMENT_VERSION: ${{ github.event.inputs.nextDevVersion }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_PRIVATE_KEY }}

steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.targetBranch }}
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: '17'
server-id: sonatype-nexus-snapshots
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE

- name: Install dependencies
run: |
brew install openssl
brew install autoconf
brew install automake
brew install libtool

- name: change version to release (and commit)
run: |
DEVELOPMENT_VERSION=$RELEASE_VERSION setversion.sh
git -am "Set release version, $RELEASE_VERSION"

- name: build natives
run: ./build.sh

- name: Maven deploy (staging)
run: mvn -Probovm-release clean deploy

- name: Gradle plugin deploy (staging)
run: cd plugins/gradle && ./gradlew clean build publish && ./gradlew jreleaserDeploy

- name: change version to next dev (and commit)
run: |
DEVELOPMENT_VERSION=NEXT_DEVELOPMENT_VERSION setversion.sh
git commit -am "Set next development version, $NEXT_DEVELOPMENT_VERSION"

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_ACCESS_KEY_SECRET }}
aws-region: eu-west-3

- name: Deploy idea plugin
run: aws s3 sync ./plugins/idea/build/distributions/ s3://${{ secrets.AWS_BUCKET }}/tmp_snapshots/idea --acl public-read --follow-symlinks --delete

- name: Deploy eclipse plugin
run: aws s3 sync ./plugins/eclipse/update-site/target/repository/ s3://${{ secrets.AWS_BUCKET }}/tmp_snapshots/eclipse --acl public-read --follow-symlinks --delete

- name: Create a draft release
uses: ncipollo/release-action@v1
with:
name: "${{ github.event.inputs.tagName }}"
body: "${{ github.event.inputs.releaseMessage }}"
tag: "${{ github.event.inputs.tagName }}"
draft: true
artifacts: "plugins/idea/build/distributions/*"
token: ${{ secrets.GITHUB_TOKEN }}

- name: Pushes changes as last step
run: git push
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
set -e
mvn -T 10 clean install
./plugins/idea/gradlew -b plugins/idea/build.gradle clean buildPlugin
mvn -f plugins/eclipse/pom.xml clean install
mvn -T 10 -f plugins/eclipse/pom.xml clean install
./plugins/gradle/gradlew -b plugins/gradle/build.gradle clean assemble validatePlugins publishToMavenLocal
49 changes: 43 additions & 6 deletions plugins/gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id 'java-gradle-plugin'
id 'groovy'
id 'maven-publish'
id "org.jreleaser" version "1.20.0"
id 'signing'
id 'eclipse'
}
Expand Down Expand Up @@ -97,13 +98,49 @@ publishing {
}
}
repositories {
if (project.version.toString().endsWith("-SNAPSHOT")) {
// snapshots are going to sonatype
maven {
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
url = uri("https://central.sonatype.com/repository/maven-snapshots/")
}
} else {
// local staging repository for JReleaser
maven {
url = uri(layout.buildDirectory.dir("staging-deploy"))
}
}
}
}


// https://central.sonatype.org/publish/publish-portal-gradle/
jreleaser {
signing {
setActive("ALWAYS")
armored = true
}
deploy {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://central.sonatype.com/repository/maven-snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD") }
mavenCentral {
create("sonatype") {
setActive("RELEASE")
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
url = "https://central.sonatype.com/api/v1/publisher"
stagingRepository("build/staging-deploy")
setStage("UPLOAD") // OTHERWISE it will do "publish"
}
}
}
}
release {
github {
skipRelease = true
token = "-" // must be not blank
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/gradle/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
23 changes: 16 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@


<properties>
<sonatypeOssDistMgmtSnapshotsUrl>https://central.sonatype.com/repository/maven-snapshots/</sonatypeOssDistMgmtSnapshotsUrl>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand All @@ -72,6 +71,10 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
Expand Down Expand Up @@ -320,13 +323,8 @@
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>${sonatypeOssDistMgmtSnapshotsUrl}</url>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
</snapshotRepository>
<repository>
<id>sonatype-nexus-staging</id>
<name>Nexus Release Repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<!-- end of: entries from sonatype oss-parent-->

Expand Down Expand Up @@ -474,6 +472,17 @@
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
</plugin>
<!-- Central publishing -->
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.8.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>sonatype-nexus-snapshots</publishingServerId>
<autoPublish>false</autoPublish>
</configuration>
</plugin>
</plugins>
</pluginManagement>

Expand Down
44 changes: 44 additions & 0 deletions setversion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/sh
#
# run as
# DEVELOPMENT_VERSION=2.3.24 ./setversion.sh
#
set -e
: ${DEVELOPMENT_VERSION?"Need to set env var DEVELOPMENT_VERSION for next development version"}
export TIMESTAMP=`date +"%Y%m%d%H%M"`

#
# set maven version everywhere
#
mvn versions:set -DnewVersion="$DEVELOPMENT_VERSION"
mvn versions:commit


#
# update plugins/eclipse
#
pushd plugins/eclipse
## Set the pom version to the next development version
mvn org.eclipse.tycho:tycho-versions-plugin:1.5.1:set-version -DnewVersion="$DEVELOPMENT_VERSION"
mv pom.xml pom.xml.bak && sed "s/<robovm.version>.*<\/robovm.version>/<robovm.version>$DEVELOPMENT_VERSION<\/robovm.version>/" pom.xml.bak > pom.xml
rm pom.xml.bak
popd

#
# update plugins/idea
#
# Set the pom version to the next development version (it always have to be development)
pushd plugins/idea
mvn versions:set -DnewVersion=$DEVELOPMENT_VERSION
mvn versions:commit
mv pom.xml pom.xml.bak && sed "s/<robovm.version>.*<\/robovm.version>/<robovm.version>$DEVELOPMENT_VERSION<\/robovm.version>/" pom.xml.bak > pom.xml
rm pom.xml.bak
popd

#
# update Gradle plugin
#
pushd plugins/gradle
sed "s/^version *=.*/version = '$DEVELOPMENT_VERSION'/" build.gradle | sed "s/roboVMVersion *=.*/roboVMVersion = '$DEVELOPMENT_VERSION'/" > build.gradle.tmp
mv build.gradle.tmp build.gradle
popd
Loading