Skip to content

Commit

Permalink
CI config
Browse files Browse the repository at this point in the history
  • Loading branch information
ForteScarlet committed Jan 25, 2024
1 parent a82de5a commit 2e82f83
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ env:
jobs:
test-build-publish:
name: Test and build
# runs-on: ubuntu-latest
# runs-on: ubuntu-latest
strategy:
matrix:
os: [ macos-latest, windows-latest, ubuntu-latest ]
Expand Down Expand Up @@ -96,17 +96,35 @@ jobs:
create-release:
name: Create release
runs-on: ubuntu-latest
needs: [test-build-publish, publish-gradle-plugin]
needs: [ test-build-publish, publish-gradle-plugin ]
permissions:
contents: write
steps:
# 检出仓库代码
- name: Check out repo
uses: actions/checkout@v3

# Setup java
# https://github.com/marketplace/actions/setup-java-jdk
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- name: Create changelog
uses: gradle/gradle-build-action@v2
with:
gradle-version: 8.5
arguments: createChangelog

# https://github.com/softprops/action-gh-release
# Create gitHub release
- name: Create Github Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.FORTE_TOKEN }}
draft: true
# body_path: .changelog/${{ github.ref_name }}.md
body_path: .changelog/${{ github.ref_name }}.md
generate_release_notes: true
prerelease: ${{ contains(github.ref_name, 'preview') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'alpha') }}
13 changes: 13 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,16 @@ allprojects {

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

tasks.create("createChangelog") {
group = "documentation"
doFirst {
val tag = "v${IProject.version}"
val changelogDir = rootProject.file(".changelog").apply { mkdirs() }
with(File(changelogDir, "$tag.md")) {
if (!exists()) {
createNewFile()
}
writeText("Kotlin version: `v${libs.versions.kotlin.get()}`")
}
}
}

0 comments on commit 2e82f83

Please sign in to comment.