-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from Liftric/feature/manual_release
Feature/manual release
- Loading branch information
Showing
14 changed files
with
348 additions
and
188 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
name: Pre Merge Checks | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
gradle: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
# needed for FirstCommitHashTaskTest | ||
fetch-depth: 0 | ||
- name: Cache | ||
uses: gradle/gradle-build-action@v2 | ||
- name: Build | ||
run: ./gradlew build | ||
- name: Validate | ||
run: ./gradlew check validatePlugins --continue |
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,27 @@ | ||
name: Publish to Gradle Plugin Portal | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
gradle: | ||
runs-on: ubuntu-latest | ||
env: | ||
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }} | ||
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
# needed for FirstCommitHashTaskTest | ||
fetch-depth: 0 | ||
- name: Cache | ||
uses: gradle/gradle-build-action@v2 | ||
- name: Build | ||
run: ./gradlew build | ||
- name: Validate | ||
run: ./gradlew validatePlugins --continue | ||
- name: Publish | ||
run: ./gradlew publishPlugins |
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
26 changes: 26 additions & 0 deletions
26
src/main/kotlin/com/liftric/octopusdeploy/buildinformation.kt
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,26 @@ | ||
package com.liftric.octopusdeploy | ||
|
||
import com.liftric.octopusdeploy.api.CommitCli | ||
import com.liftric.octopusdeploy.api.WorkItem | ||
|
||
fun parseCommitsForJira( | ||
commits: List<CommitCli>, | ||
jiraBaseBrowseUrl: String | ||
): List<WorkItem> { | ||
val jiraIssues = commits | ||
.mapNotNull { it.Comment } | ||
.map { jiraKeyRegex.findAll(it).map { it.groupValues[1] }.toList() } | ||
.flatten() | ||
.toSet() | ||
println("parseCommitsForJira: found $jiraIssues") | ||
return jiraIssues.map { | ||
WorkItem( | ||
Id = it, | ||
LinkUrl = "${jiraBaseBrowseUrl.removeSuffix("/")}/$it", | ||
Description = "some placeholder text" | ||
) | ||
} | ||
} | ||
|
||
// from https://confluence.atlassian.com/stashkb/integrating-with-custom-jira-issue-key-313460921.html | ||
private val jiraKeyRegex = Regex("((?<!([A-Z]{1,10})-?)[A-Z]+-\\d+)") |
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
42 changes: 42 additions & 0 deletions
42
src/main/kotlin/com/liftric/octopusdeploy/task/AbstractBuildInformationTask.kt
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,42 @@ | ||
package com.liftric.octopusdeploy.task | ||
|
||
import com.liftric.octopusdeploy.api.BuildInformationCli | ||
import com.liftric.octopusdeploy.api.CommitCli | ||
import org.gradle.api.DefaultTask | ||
import org.gradle.api.provider.Property | ||
import org.gradle.api.tasks.Input | ||
import org.gradle.api.tasks.Optional | ||
import org.gradle.api.tasks.OutputFile | ||
import org.gradle.kotlin.dsl.property | ||
import java.io.File | ||
|
||
abstract class AbstractBuildInformationTask : DefaultTask() { | ||
|
||
@Input | ||
val packageName: Property<String> = project.objects.property() | ||
|
||
@Input | ||
val version: Property<String> = project.objects.property() | ||
|
||
@Input | ||
lateinit var commits: List<CommitCli> | ||
|
||
@Input | ||
var buildInformationAddition: BuildInformationCli.() -> Unit = {} | ||
|
||
@OutputFile | ||
@Optional | ||
var outputFile: File? = null | ||
|
||
@Input | ||
@Optional | ||
val issueTrackerName: Property<String> = project.objects.property() | ||
|
||
@Input | ||
@Optional | ||
val parseCommitsForJiraIssues: Property<Boolean> = project.objects.property() | ||
|
||
@Input | ||
@Optional | ||
val jiraBaseBrowseUrl: Property<String> = project.objects.property() | ||
} |
Oops, something went wrong.