-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Build] Add workflows for automatic releases
- Loading branch information
Showing
10 changed files
with
190 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,24 @@ | ||
import tool.UpVersion | ||
|
||
allprojects { | ||
group 'imgui-java' | ||
version property('version') | ||
repositories { | ||
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" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-7.0.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,7 @@ jar { | |
|
||
shadowJar { | ||
with jar | ||
archiveClassifier.set(null) | ||
} | ||
|
||
apply from: "$rootDir/publish.gradle" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters