Skip to content

Commit

Permalink
feature: custom plugin repo
Browse files Browse the repository at this point in the history
  • Loading branch information
popovanton0 committed Jul 4, 2024
1 parent 657ecb7 commit 7f174a6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/publish-ide-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,19 @@ jobs:
id: print_version
run: echo "plugin-version=$(cat build/VERSION)" >> $GITHUB_OUTPUT

- name: Release plugin
- name: Create plugin repo release
uses: ncipollo/release-action@v1
with:
tag: ideRepo
artifacts: "./build/updatePlugins.xml"
allowUpdates: true
makeLatest: false

- name: Create plugin release
uses: ncipollo/release-action@v1
with:
tag: v${{ steps.print_version.outputs.plugin-version }}
artifacts: "./build/github-release/*"
artifacts: "./build/distributions/*"
body: "TODO"
draft: true
makeLatest: true
10 changes: 3 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ tasks {
}
}

val toGitHubReleaseDir = project.layout.buildDirectory.dir("github-release")

val updateLocalPluginXmlTask = tasks.register<UpdateXmlTask>("updateLocalPluginXml") {
pluginName = properties("pluginName")
pluginId = properties("pluginGroup")
Expand All @@ -144,14 +142,12 @@ val updateLocalPluginXmlTask = tasks.register<UpdateXmlTask>("updateLocalPluginX
sinceBuild = properties("pluginSinceBuild")
changeNotes = kelpChangeNotes.get()

updateFile = toGitHubReleaseDir.map { it.file("updatePlugins.xml") }
downloadUrl = "${properties("pluginRepositoryUrl").get()}/releases/latest/download/${pluginName.get()}-${version.get()}.zip"
updateFile = layout.buildDirectory.file("updatePlugins.xml")
downloadUrl = "${properties("pluginRepositoryUrl").get()}/releases/download/v${version.get()}/${pluginName.get()}-${version.get()}.zip"
}

tasks.register<Copy>("buildKelpIdePlugin") {
dependsOn(updateLocalPluginXmlTask)
from(project.tasks.named<BuildPluginTask>("buildPlugin").flatMap { it.archiveFile })
into(toGitHubReleaseDir)
dependsOn(updateLocalPluginXmlTask, tasks.named<BuildPluginTask>("buildPlugin"))
}

tasks.register("readVersion") {
Expand Down

0 comments on commit 7f174a6

Please sign in to comment.