Skip to content

Commit

Permalink
fix: enhanced dsl and fixed maven version release
Browse files Browse the repository at this point in the history
  • Loading branch information
ennioVisco committed Jun 17, 2024
1 parent a11fbad commit d2156ab
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,24 @@ jobs:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Strip the 'v' character from the version number
id: strip
run: echo "${{ needs.infer-version.outputs.version }}" | cut -c 2-
shell: bash
env:
OUTPUT: ${{ needs.infer-version.outputs.version }}
- name: Change wrapper permissions
run: chmod +x gradlew
- name: Run gradle publish (MavenCentral)
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-configuration-cache
env:
ORG_GRADLE_PROJECT_projectVersion: ${{ needs.infer-version.outputs.version }}
ORG_GRADLE_PROJECT_projectVersion: ${{ steps.strip.outputs.stripped }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
- name: Nyx publish (Github Release)
uses: mooltiverse/nyx-github-action@main
uses: mooltiverse/nyx-github-action
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NYX_RELEASE_TYPES_PUBLICATION_SERVICES: 'GITHUB'
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/com/enniovisco/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import java.net.*
private typealias ResultData = List<Map<String, String>>
private typealias Metadata = Map<String, String>

fun main(args: Array<String>, preloaded: Boolean = false) {
fun main(args: Array<String>, preloaded: Boolean = false, toFile : Boolean = true, toConsole: Boolean = false) {
println("Running....")
Cli(args, toFile = true, toConsole = true, preloaded = preloaded) {
Cli(args, toFile = toFile, toConsole = toConsole, preloaded = preloaded) {
it.title("Tracking")
val snapshots = tracking(it)

Expand Down
5 changes: 4 additions & 1 deletion src/main/kotlin/com/enniovisco/dsl/Dsl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import com.enniovisco.main
typealias Browser = com.enniovisco.tracking.Browser

class WebMonitor {
val toFile = true
val toConsole = false

fun webSource(init: WebSource.() -> Unit): WebSource {
WebSource.init()
return WebSource
Expand All @@ -26,5 +29,5 @@ fun monitor(init: WebMonitor.()-> Unit) {
val webmonitor = WebMonitor()
webmonitor.init()
println("Starting WebMonitor...")
main(emptyArray(), preloaded = true)
main(emptyArray(), preloaded = true, toFile = webmonitor.toFile, toConsole = webmonitor.toConsole)
}
8 changes: 4 additions & 4 deletions test.main.kts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#!/usr/bin/env kotlin

@file:DependsOn("com.enniovisco:webmonitor:v1.2.0-beta.5")
@file:DependsOn("com.enniovisco:webmonitor:v1.2.0-beta.7")
////@file:DependesOn("org.slf4j:slf4j-simple:2.0.13")
//@file:DependsOn("io.github.oshai:kotlin-logging-jvm:6.0.9")
//@file:DependsOn("org.slf4j:slf4j-api:2.0.7")
//@file:DependsOn("ch.qos.logback:logback-classic:1.5.6")

import com.enniovisco.dsl.*
import com.enniovisco.*

monitor {

webSource {
screenWidth = 393 // px
screenHeight = 851 // px
// To date Google Chrome is the browser with the most stable APIs
browser = Browser.FIREFOX
browser = Browser.CHROME_HEADLESS
wait = 0
maxSessionDuration = 5_000 // ms
targetUrl = "https://enniovisco.github.io/webmonitor/sample.html"
Expand All @@ -33,7 +33,7 @@ monitor {
}
}

println(WebSource.screenWidth)
//println(WebSource.screenWidth)

//print(
// createHTML().html {
Expand Down

0 comments on commit d2156ab

Please sign in to comment.