Skip to content

Commit 2e82f83

Browse files
committed
CI config
1 parent a82de5a commit 2e82f83

File tree

2 files changed

+34
-3
lines changed

2 files changed

+34
-3
lines changed

.github/workflows/publish-release.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ env:
2121
jobs:
2222
test-build-publish:
2323
name: Test and build
24-
# runs-on: ubuntu-latest
24+
# runs-on: ubuntu-latest
2525
strategy:
2626
matrix:
2727
os: [ macos-latest, windows-latest, ubuntu-latest ]
@@ -96,17 +96,35 @@ jobs:
9696
create-release:
9797
name: Create release
9898
runs-on: ubuntu-latest
99-
needs: [test-build-publish, publish-gradle-plugin]
99+
needs: [ test-build-publish, publish-gradle-plugin ]
100100
permissions:
101101
contents: write
102102
steps:
103+
# 检出仓库代码
104+
- name: Check out repo
105+
uses: actions/checkout@v3
106+
107+
# Setup java
108+
# https://github.com/marketplace/actions/setup-java-jdk
109+
- name: Setup Java
110+
uses: actions/setup-java@v3
111+
with:
112+
distribution: 'zulu'
113+
java-version: 11
114+
115+
- name: Create changelog
116+
uses: gradle/gradle-build-action@v2
117+
with:
118+
gradle-version: 8.5
119+
arguments: createChangelog
120+
103121
# https://github.com/softprops/action-gh-release
104122
# Create gitHub release
105123
- name: Create Github Release
106124
uses: softprops/action-gh-release@v1
107125
with:
108126
token: ${{ secrets.FORTE_TOKEN }}
109127
draft: true
110-
# body_path: .changelog/${{ github.ref_name }}.md
128+
body_path: .changelog/${{ github.ref_name }}.md
111129
generate_release_notes: true
112130
prerelease: ${{ contains(github.ref_name, 'preview') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'alpha') }}

build.gradle.kts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,16 @@ allprojects {
3030

3131
apply(plugin = "suspend-transform.nexus-publish")
3232

33+
tasks.create("createChangelog") {
34+
group = "documentation"
35+
doFirst {
36+
val tag = "v${IProject.version}"
37+
val changelogDir = rootProject.file(".changelog").apply { mkdirs() }
38+
with(File(changelogDir, "$tag.md")) {
39+
if (!exists()) {
40+
createNewFile()
41+
}
42+
writeText("Kotlin version: `v${libs.versions.kotlin.get()}`")
43+
}
44+
}
45+
}

0 commit comments

Comments
 (0)