Skip to content

Commit

Permalink
Update github-workflows-kt version to 2.3.0 and Maven-based bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire committed Aug 8, 2024
1 parent c02372f commit 1520e8d
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 31 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/branches-and-prs.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@
*/

@file:Import("common.main.kts")
@file:Repository("https://bindings.krzeminski.it/")
@file:DependsOn("actions:checkout:v4")
@file:DependsOn("codecov:codecov-action:v4")

import io.github.typesafegithub.workflows.actions.actions.CheckoutV4
import io.github.typesafegithub.workflows.actions.codecov.CodecovActionV4
import io.github.typesafegithub.workflows.actions.actions.Checkout
import io.github.typesafegithub.workflows.actions.actions.Checkout.FetchDepth
import io.github.typesafegithub.workflows.actions.codecov.CodecovAction
import io.github.typesafegithub.workflows.domain.Concurrency
import io.github.typesafegithub.workflows.domain.RunnerType
import io.github.typesafegithub.workflows.domain.RunnerType.UbuntuLatest
Expand Down Expand Up @@ -57,7 +61,7 @@ workflow(
) {
uses(
name = "Checkout Repository",
action = CheckoutV4()
action = Checkout()
)
run(
name = "Regenerate all workflow YAMLs and check for modifications",
Expand All @@ -75,9 +79,9 @@ workflow(
) {
uses(
name = "Checkout Repository",
action = CheckoutV4(
action = Checkout(
// Codecov needs fetch-depth > 1
fetchDepth = CheckoutV4.FetchDepth.Value(2)
fetchDepth = FetchDepth.Value(2)
)
)
uses(
Expand All @@ -100,7 +104,7 @@ workflow(
)
uses(
name = "Upload to Codecov.io",
action = CodecovActionV4()
action = CodecovAction()
)
}
}
19 changes: 11 additions & 8 deletions .github/workflows/codeql-analysis.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@
*/

@file:Import("common.main.kts")
@file:Repository("https://bindings.krzeminski.it/")
@file:DependsOn("actions:checkout:v4")
@file:DependsOn("github:codeql-action__analyze:v3")
@file:DependsOn("github:codeql-action__init:v3")

import io.github.typesafegithub.workflows.actions.actions.CheckoutV4
import io.github.typesafegithub.workflows.actions.github.CodeqlActionAnalyzeV2
import io.github.typesafegithub.workflows.actions.github.CodeqlActionInitV2
import io.github.typesafegithub.workflows.actions.actions.Checkout
import io.github.typesafegithub.workflows.actions.github.CodeqlActionAnalyze
import io.github.typesafegithub.workflows.actions.github.CodeqlActionInit
import io.github.typesafegithub.workflows.domain.Concurrency
import io.github.typesafegithub.workflows.domain.RunnerType.UbuntuLatest
import io.github.typesafegithub.workflows.domain.triggers.Cron
Expand Down Expand Up @@ -71,7 +75,7 @@ workflow(
) {
uses(
name = "Checkout Repository",
action = CheckoutV4()
action = Checkout()
)
// Manually added: Install and setup JDK
uses(
Expand All @@ -81,8 +85,7 @@ workflow(
// Initializes the CodeQL tools for scanning
uses(
name = "Initialize CodeQL",
action = CodeqlActionInitV2(
_customVersion = "v3"
action = CodeqlActionInit(
// Override language selection by uncommenting this and choosing your languages
// languages = listOf("go", "javascript", "csharp", "python", "cpp", "java"),
)
Expand All @@ -91,7 +94,7 @@ workflow(
// If this step fails, then you should remove it and run the build manually (see below).
// uses(
// name = "Autobuild",
// action = CodeqlActionAutobuildV2()
// action = CodeqlActionAutobuild()
// )
//
// ℹ️ Command-line programs to run using the OS shell.
Expand Down Expand Up @@ -123,7 +126,7 @@ workflow(
)
uses(
name = "Perform CodeQL Analysis",
action = CodeqlActionAnalyzeV2(_customVersion = "v3")
action = CodeqlActionAnalyze()
)
}
}
3 changes: 2 additions & 1 deletion .github/workflows/common.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
* limitations under the License.
*/

@file:DependsOn("io.github.typesafegithub:github-workflows-kt:2.0.0")
@file:Repository("https://repo.maven.apache.org/maven2/")
@file:DependsOn("io.github.typesafegithub:github-workflows-kt:2.3.0")

import io.github.typesafegithub.workflows.domain.Job
import io.github.typesafegithub.workflows.domain.JobOutputs.EMPTY
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/docs-pr.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@
*/

@file:Import("common.main.kts")
@file:Repository("https://bindings.krzeminski.it/")
@file:DependsOn("actions:checkout:v4")
@file:DependsOn("actions:upload-artifact:v4")

import io.github.typesafegithub.workflows.actions.actions.CheckoutV4
import io.github.typesafegithub.workflows.actions.actions.UploadArtifactV4
import io.github.typesafegithub.workflows.actions.actions.Checkout
import io.github.typesafegithub.workflows.actions.actions.Checkout.FetchDepth
import io.github.typesafegithub.workflows.actions.actions.UploadArtifact
import io.github.typesafegithub.workflows.domain.Concurrency
import io.github.typesafegithub.workflows.domain.RunnerType.UbuntuLatest
import io.github.typesafegithub.workflows.domain.triggers.MergeGroup
Expand Down Expand Up @@ -56,8 +60,8 @@ workflow(
) {
uses(
name = "Checkout Repository",
action = CheckoutV4(
fetchDepth = CheckoutV4.FetchDepth.Value(1)
action = Checkout(
fetchDepth = FetchDepth.Value(1)
)
)
uses(
Expand All @@ -83,7 +87,7 @@ workflow(
)
uses(
name = "Archive and upload docs",
action = UploadArtifactV4(
action = UploadArtifact(
name = "docs",
path = listOf(
"build/docs/**",
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/gradle-wrapper-validation.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@
*/

@file:Import("common.main.kts")
@file:Repository("https://bindings.krzeminski.it/")
@file:DependsOn("actions:checkout:v4")
@file:DependsOn("gradle:wrapper-validation-action:v3")

import io.github.typesafegithub.workflows.actions.actions.CheckoutV4
import io.github.typesafegithub.workflows.actions.gradle.WrapperValidationActionV2
import io.github.typesafegithub.workflows.actions.actions.Checkout
import io.github.typesafegithub.workflows.actions.gradle.WrapperValidationAction
import io.github.typesafegithub.workflows.domain.RunnerType.UbuntuLatest
import io.github.typesafegithub.workflows.domain.triggers.MergeGroup
import io.github.typesafegithub.workflows.domain.triggers.PullRequest
Expand All @@ -43,11 +46,11 @@ workflow(
) {
uses(
name = "Checkout Repository",
action = CheckoutV4()
action = Checkout()
)
uses(
name = "Validate Wrapper",
action = WrapperValidationActionV2(_customVersion = "v3")
action = WrapperValidationAction()
)
}
}
17 changes: 10 additions & 7 deletions .github/workflows/release.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
*/

@file:Import("common.main.kts")
@file:Repository("https://bindings.krzeminski.it/")
@file:DependsOn("actions:checkout:v4")
@file:DependsOn("codecov:codecov-action:v4")

import io.github.typesafegithub.workflows.actions.actions.CheckoutV4
import io.github.typesafegithub.workflows.actions.actions.CheckoutV4.FetchDepth
import io.github.typesafegithub.workflows.actions.codecov.CodecovActionV4
import io.github.typesafegithub.workflows.actions.actions.Checkout
import io.github.typesafegithub.workflows.actions.actions.Checkout.FetchDepth
import io.github.typesafegithub.workflows.actions.codecov.CodecovAction
import io.github.typesafegithub.workflows.domain.RunnerType
import io.github.typesafegithub.workflows.domain.triggers.Push
import io.github.typesafegithub.workflows.dsl.expressions.Contexts.github
Expand Down Expand Up @@ -55,7 +58,7 @@ workflow(
) {
uses(
name = "Checkout Repository",
action = CheckoutV4(
action = Checkout(
// Codecov needs fetch-depth > 1
fetchDepth = FetchDepth.Value(2)
)
Expand Down Expand Up @@ -84,7 +87,7 @@ workflow(
)
uses(
name = "Upload to Codecov.io",
action = CodecovActionV4()
action = CodecovAction()
)
}
val releaseSpock = job(
Expand All @@ -102,7 +105,7 @@ workflow(
) {
uses(
name = "Checkout Repository",
action = CheckoutV4()
action = Checkout()
)
uses(
name = "Set up JDKs",
Expand Down Expand Up @@ -144,7 +147,7 @@ workflow(
) {
uses(
name = "Checkout Repository",
action = CheckoutV4()
action = Checkout()
)
uses(
name = "Set up JDKs",
Expand Down

0 comments on commit 1520e8d

Please sign in to comment.