[Build] Add workflows for automatic releases
This commit is contained in:
1 parent
34e282e091
commit
1544682cc4
10 files changed
+190
-27
No files matched your search
@@ -19,7 +19,7 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
uses: eskatos/gradle-command-action@v1
|
uses: eskatos/gradle-command-action@v1
|
||||||
with:
|
with:
|
||||||
arguments: build
|
arguments: buildAll
|
||||||
build-natives:
|
build-natives:
|
||||||
env:
|
env:
|
||||||
FREETYPE_URL: https://download.savannah.gnu.org/releases/freetype/freetype-2.10.4.tar.gz
|
FREETYPE_URL: https://download.savannah.gnu.org/releases/freetype/freetype-2.10.4.tar.gz
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
name: Publish to Maven
|
||||||
|
on: workflow_dispatch
|
||||||
|
jobs:
|
||||||
|
publish-modules:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
module: [imgui-app, imgui-lwjgl3, imgui-binding]
|
||||||
|
name: Publish Module (${{ matrix.module }})
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
NEXUS_UPD_ID: ${{ secrets.RELEASE_NEXUS_UPD_ID }}
|
||||||
|
NEXUS_UPD_PASS: ${{ secrets.RELEASE_NEXUS_UPD_PASS }}
|
||||||
|
SIGNING_KEY_ID: ${{ secrets.RELEASE_SIGNING_KEY_ID }}
|
||||||
|
SIGNING_KEY: ${{ secrets.RELEASE_SIGNING_KEY }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Java 8
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 8
|
||||||
|
|
||||||
|
- name: Publish
|
||||||
|
uses: eskatos/gradle-command-action@v1
|
||||||
|
with:
|
||||||
|
arguments: ${{ format(':{0}:publishMavenJavaPublicationToMavenCentralRepository', matrix.module) }}
|
||||||
|
|
||||||
|
publish-natives:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
type: [win, linux, mac]
|
||||||
|
freetype: [true, false]
|
||||||
|
name: Publish Native (type=${{ matrix.type }}, freetype=${{ matrix.freetype }})
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
NEXUS_UPD_ID: ${{ secrets.RELEASE_NEXUS_UPD_ID }}
|
||||||
|
NEXUS_UPD_PASS: ${{ secrets.RELEASE_NEXUS_UPD_PASS }}
|
||||||
|
SIGNING_KEY_ID: ${{ secrets.RELEASE_SIGNING_KEY_ID }}
|
||||||
|
SIGNING_KEY: ${{ secrets.RELEASE_SIGNING_KEY }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Java 8
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 8
|
||||||
|
|
||||||
|
- name: Publish
|
||||||
|
uses: eskatos/gradle-command-action@v1
|
||||||
|
with:
|
||||||
|
arguments: ${{ format(':imgui-binding-natives:publishMavenJavaPublicationToMavenCentralRepository -PdeployType={0} -Pfreetype={1}', matrix.type, matrix.freetype) }}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
name: Release
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: 'Version'
|
||||||
|
required: true
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
name: Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Up Version
|
||||||
|
uses: eskatos/gradle-command-action@v1
|
||||||
|
with:
|
||||||
|
arguments: ${{ format('upVersion -Pnext={0}', github.event.inputs.version) }}
|
||||||
|
|
||||||
|
- name: Commit Version
|
||||||
|
uses: EndBug/add-and-commit@v7
|
||||||
|
with:
|
||||||
|
default_author: github_actions
|
||||||
|
message: ${{ format('v{0}', github.event.inputs.version) }}
|
||||||
|
|
||||||
|
- name: Push Tag
|
||||||
|
uses: mathieudutour/github-tag-action@v5.5
|
||||||
|
id: tag_version
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
custom_tag: ${{ github.event.inputs.version }}
|
||||||
|
|
||||||
|
- name: Build All
|
||||||
|
uses: eskatos/gradle-command-action@v1
|
||||||
|
with:
|
||||||
|
arguments: buildAll
|
||||||
|
|
||||||
|
- name: Generate changelog
|
||||||
|
id: changelog
|
||||||
|
uses: metcalfc/changelog-generator@v1.0.0
|
||||||
|
with:
|
||||||
|
myToken: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Release
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
body: ${{ steps.tag_version.outputs.changelog }} ${{ steps.changelog.outputs.changelog }}
|
||||||
|
tag_name: ${{ steps.tag_version.outputs.new_tag }}
|
||||||
|
draft: true
|
||||||
|
prerelease: false
|
||||||
|
files: |
|
||||||
|
imgui-app/build/libs/*.jar
|
||||||
|
imgui-binding/build/libs/*.jar
|
||||||
|
imgui-lwjgl3/build/libs/*.jar
|
||||||
|
bin/imgui-java64.dll
|
||||||
|
bin/libimgui-java64.dylib
|
||||||
|
bin/libimgui-java64.so
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import tool.UpVersion
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
group 'imgui-java'
|
group 'imgui-java'
|
||||||
version property('version')
|
version property('version')
|
||||||
@@ -5,3 +7,18 @@ allprojects {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.register('upVersion', UpVersion)
|
||||||
|
|
||||||
|
tasks.register('buildAll') { t ->
|
||||||
|
t.group = 'build'
|
||||||
|
t.description = 'Build all project sources.'
|
||||||
|
|
||||||
|
t.dependsOn ':imgui-app:shadowJar'
|
||||||
|
|
||||||
|
['app', 'binding', 'lwjgl3'].each { module ->
|
||||||
|
['build', 'sourcesJar', 'javadocJar'].each { task ->
|
||||||
|
t.dependsOn ":imgui-$module:$task"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package tool
|
||||||
|
|
||||||
|
import groovy.transform.CompileStatic
|
||||||
|
import org.gradle.api.DefaultTask
|
||||||
|
import org.gradle.api.tasks.Internal
|
||||||
|
import org.gradle.api.tasks.TaskAction
|
||||||
|
|
||||||
|
@CompileStatic
|
||||||
|
class UpVersion extends DefaultTask {
|
||||||
|
@Internal
|
||||||
|
String group = 'build'
|
||||||
|
@Internal
|
||||||
|
String description = 'Up project version to the next one.'
|
||||||
|
|
||||||
|
private final String currentVersion = project.findProperty('version')
|
||||||
|
private final String nextVersion = project.findProperty('next')
|
||||||
|
|
||||||
|
@TaskAction
|
||||||
|
void up() {
|
||||||
|
if (!currentVersion) {
|
||||||
|
throw new IllegalArgumentException('No property was found: "version"')
|
||||||
|
}
|
||||||
|
if (!nextVersion) {
|
||||||
|
throw new IllegalArgumentException('No property was found: "next"')
|
||||||
|
}
|
||||||
|
|
||||||
|
def propsFile = project.file('gradle.properties')
|
||||||
|
propsFile.text = propsFile.text.replace("version=$currentVersion", "version=$nextVersion")
|
||||||
|
|
||||||
|
def readmeFile = project.file('README.md')
|
||||||
|
readmeFile.text = readmeFile.text.replace(currentVersion, nextVersion)
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
@@ -43,6 +43,7 @@ jar {
|
|||||||
|
|
||||||
shadowJar {
|
shadowJar {
|
||||||
with jar
|
with jar
|
||||||
|
archiveClassifier.set(null)
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/publish.gradle"
|
apply from: "$rootDir/publish.gradle"
|
||||||
|
|||||||
@@ -9,21 +9,25 @@ def packageDesc = 'Native binaries for imgui-java binding for Linux'
|
|||||||
def fromDir = '../bin'
|
def fromDir = '../bin'
|
||||||
def libName = 'libimgui-java64.so'
|
def libName = 'libimgui-java64.so'
|
||||||
|
|
||||||
if (System.getProperty('deployWin')) {
|
switch (findProperty('deployType')) {
|
||||||
packageName = 'imgui-java-natives-windows'
|
case 'win':
|
||||||
packageDesc = 'Native binaries for imgui-java binding for Windows'
|
packageName = 'imgui-java-natives-windows'
|
||||||
libName = 'imgui-java64.dll'
|
packageDesc = 'Native binaries for imgui-java binding for Windows'
|
||||||
} else if (System.getProperty('deployLinux')) {
|
libName = 'imgui-java64.dll'
|
||||||
packageName = 'imgui-java-natives-linux'
|
break
|
||||||
packageDesc = 'Native binaries for imgui-java binding for Linux'
|
case 'linux':
|
||||||
libName = 'libimgui-java64.so'
|
packageName = 'imgui-java-natives-linux'
|
||||||
} else if (System.getProperty('deployMac')) {
|
packageDesc = 'Native binaries for imgui-java binding for Linux'
|
||||||
packageName = 'imgui-java-natives-macos'
|
libName = 'libimgui-java64.so'
|
||||||
packageDesc = 'Native binaries for imgui-java binding for MacOS'
|
break
|
||||||
libName = 'libimgui-java64.dylib'
|
case 'mac':
|
||||||
|
packageName = 'imgui-java-natives-macos'
|
||||||
|
packageDesc = 'Native binaries for imgui-java binding for MacOS'
|
||||||
|
libName = 'libimgui-java64.dylib'
|
||||||
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if (System.getProperty('freetype')) {
|
if (findProperty('freetype') == 'true') {
|
||||||
packageName += '-ft'
|
packageName += '-ft'
|
||||||
packageDesc += ' with Freetype support'
|
packageDesc += ' with Freetype support'
|
||||||
fromDir += '/freetype'
|
fromDir += '/freetype'
|
||||||
|
|||||||
@@ -307,16 +307,8 @@ public final class ImGuizmo {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if we're over the current operation
|
* Checks if we're over the current operation.
|
||||||
*
|
* One of {@link imgui.extension.imguizmo.flag.Operation}.
|
||||||
* One of:
|
|
||||||
* <table summary="">
|
|
||||||
* <tr>
|
|
||||||
* <td>{@link imgui.extension.imguizmo.flag.Operation#ROTATE}</td>
|
|
||||||
* <td>{@link imgui.extension.imguizmo.flag.Operation#SCALE}</td>
|
|
||||||
* <td>{@link imgui.extension.imguizmo.flag.Operation#TRANSLATE}</td>
|
|
||||||
* </tr>
|
|
||||||
* </table>
|
|
||||||
*
|
*
|
||||||
* @param operation target
|
* @param operation target
|
||||||
*/
|
*/
|
||||||
|
|||||||
+5
-2
@@ -17,8 +17,8 @@ ext.configurePublishing = { packageName, packageDesc ->
|
|||||||
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
|
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
|
||||||
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
|
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
|
||||||
credentials {
|
credentials {
|
||||||
username = findProperty('nexusUpdId') ?: ''
|
username = System.getenv('NEXUS_UPD_ID')
|
||||||
password = findProperty('nexusUpdPass') ?: ''
|
password = System.getenv('NEXUS_UPD_PASS')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -59,6 +59,9 @@ ext.configurePublishing = { packageName, packageDesc ->
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
signing {
|
signing {
|
||||||
|
def signingKeyId = System.getenv('SIGNING_KEY_ID')
|
||||||
|
def signingKey = System.getenv('SIGNING_KEY')
|
||||||
|
useInMemoryPgpKeys(signingKeyId, signingKey, '')
|
||||||
sign publishing.publications.mavenJava
|
sign publishing.publications.mavenJava
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user