Skip to content

Commit a2c47b8

Browse files
committed
chore: add github action release step
1 parent 95c6202 commit a2c47b8

File tree

4 files changed

+105
-8
lines changed

4 files changed

+105
-8
lines changed

.github/config/configuration.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
{
2828
"title": "## 🖍️ Documentation",
2929
"labels": [
30-
"doc"
30+
"doc",
31+
"docs"
3132
]
3233
},
3334
{
@@ -37,6 +38,13 @@
3738
"dependencies",
3839
"chore(deps)"
3940
]
41+
},
42+
{
43+
"title": "## 💬 Other",
44+
"labels": [
45+
"other",
46+
"misc"
47+
]
4048
}
4149
],
4250
"sort": "ASC",

.github/config/release-drafter.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name-template: 'v$RESOLVED_VERSION 🌈'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
categories:
4+
- title: '🚀 Features'
5+
labels:
6+
- 'feat'
7+
- 'feature'
8+
- 'enhancement'
9+
- title: '🐛 Bug Fixes'
10+
labels:
11+
- 'fix'
12+
- 'bugfix'
13+
- 'bug'
14+
- title: '🧰 Maintenance'
15+
label: 'chore'
16+
- title: "📝 Documentation"
17+
labels:
18+
- 'doc'
19+
- 'documentation'
20+
- title: "🧪 Tests"
21+
labels:
22+
- 'test'
23+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
24+
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
25+
version-resolver:
26+
major:
27+
labels:
28+
- 'major'
29+
minor:
30+
labels:
31+
- 'minor'
32+
patch:
33+
labels:
34+
- 'patch'
35+
default: patch
36+
template: |
37+
## Changes
38+
39+
$CHANGES

.github/workflows/graalvm.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
os: [ macos-latest, windows-latest, ubuntu-latest ]
4646

4747
outputs:
48+
version: ${{ steps.native-build.outputs.version }}
4849
native_image_name: ${{ steps.native-build.outputs.native_image_name }}
4950

5051
steps:
@@ -115,3 +116,42 @@ jobs:
115116
path: |
116117
build/${{ steps.native-build.outputs.native_image_name }}
117118
if-no-files-found: error
119+
120+
release:
121+
name: 🚰 Release new version.
122+
needs: [ native-build, native-build-musl ]
123+
if: startsWith(github.ref, 'refs/tags/') && needs.native-build.result == 'success'
124+
runs-on: ubuntu-latest
125+
126+
steps:
127+
- name: 🛎️Check out the source code
128+
uses: actions/checkout@v3
129+
with:
130+
fetch-depth: 0
131+
submodules: recursive
132+
133+
- name: ⚙️Build Changelog
134+
id: github_release
135+
uses: mikepenz/release-changelog-builder-action@v3
136+
with:
137+
configuration: ".github/config/configuration.json"
138+
commitMode: true
139+
ignorePreReleases: ${{ !contains(github.ref, '-') }}
140+
env:
141+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142+
143+
- name: ⏬Download all the build artifacts
144+
uses: actions/download-artifact@v3
145+
with:
146+
path: release-artifacts
147+
148+
- name: ✨Github Release (version = ${{ needs.native-build.outputs.version }})
149+
uses: softprops/action-gh-release@v1
150+
with:
151+
body: ${{ steps.github_release.outputs.changelog }}
152+
files: |
153+
${{ github.workspace }}/release-artifacts/**
154+
generate_release_notes: true
155+
fail_on_unmatched_files: true
156+
env:
157+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

gradle/build-logic/common-plugins/src/main/kotlin/plugins/graalvm.gradle.kts

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package plugins
33
import GithubAction
44
import Platform
55
import com.javiersc.semver.project.gradle.plugin.SemverExtension
6+
import dev.suresh.gradle.byteDisplaySize
7+
import dev.suresh.gradle.jvmArguments
68
import dev.suresh.gradle.libs
79
import org.jetbrains.kotlin.gradle.utils.extendsFrom
810

@@ -21,8 +23,11 @@ val muslEnabled = project.hasProperty("musl")
2123

2224
application {
2325
mainClass = libs.versions.app.mainclass
24-
applicationDefaultJvmArgs +=
25-
listOf("--show-version", "--enable-preview", "--add-modules=ALL-SYSTEM")
26+
applicationDefaultJvmArgs += buildList {
27+
addAll(jvmArguments)
28+
add("--show-version")
29+
add("--add-modules=ALL-SYSTEM")
30+
}
2631
}
2732

2833
val semverExtn = extensions.getByType<SemverExtension>()
@@ -107,7 +112,7 @@ graalvmNative {
107112
* - graalCompileClasspath (CompileOnly + Implementation)
108113
* - graalRuntimeClasspath (RuntimeOnly + Implementation)
109114
*
110-
* [Configure Custom-SourceSet](https://docs.gradle.org/current/userguide/java_testing.html#sec:configuring_java_integration_tests)
115+
* [Configure-Custom-SourceSet](https://docs.gradle.org/current/userguide/java_testing.html#sec:configuring_java_integration_tests)
111116
*/
112117
val graal by
113118
sourceSets.creating {
@@ -136,10 +141,15 @@ tasks {
136141
destinationDirectory = project.layout.buildDirectory
137142
from(nativeCompile.map { it.outputFile })
138143
doLast {
139-
// Set the output for the Github Action
140-
GithubAction.setOutput("native_image_name", archiveFileName)
141-
GithubAction.setOutput("native_image_path", archiveFile.get().asFile.absolutePath)
142-
logger.lifecycle("Native Image Archive: ${archiveFile.get().asFile.absolutePath}")
144+
// Set the output for the GitHub native-build action.
145+
with(GithubAction) {
146+
setOutput("version", project.version)
147+
setOutput("native_image_name", archiveFileName.get())
148+
setOutput("native_image_path", archiveFile.get().asFile.absolutePath)
149+
}
150+
val binFile = archiveFile.get().asFile
151+
logger.lifecycle(
152+
"Native Image Archive: ${binFile.absolutePath} (${binFile.length().byteDisplaySize()})")
143153
}
144154
}
145155

0 commit comments

Comments
 (0)