From 228ed1c90841edd4cb8a54e989a7b8639b86b520 Mon Sep 17 00:00:00 2001 From: Sakib Hadziavdic Date: Wed, 25 Dec 2024 22:30:37 +0100 Subject: [PATCH 1/7] Bump version to 0.8.2-SNAPSHOT --- build.mill | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.mill b/build.mill index 65f5da5..56ac144 100644 --- a/build.mill +++ b/build.mill @@ -8,7 +8,7 @@ import mill.scalalib._, scalafmt._, publish._ import mill.contrib.sonatypecentral.SonatypeCentralPublishModule import ba.sake.millhepek.MillHepekModule -val sharafVersion = "0.8.1" +val sharafVersion = "0.8.2-SNAPSHOT" object sharaf extends SharafPublishModule { From 2e273a250996c9decac9c6be8bfeee41dc7675b3 Mon Sep 17 00:00:00 2001 From: Sakib Hadziavdic Date: Mon, 24 Mar 2025 01:22:02 +0100 Subject: [PATCH 2/7] Add support for WebJars --- .mill-version | 2 +- DEV.md | 6 +++--- build.mill | 8 +++++--- sharaf/src/ba/sake/sharaf/handlers/SharafHandler.scala | 5 ++++- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.mill-version b/.mill-version index 7fd0b1e..e829fc1 100644 --- a/.mill-version +++ b/.mill-version @@ -1 +1 @@ -0.12.4 \ No newline at end of file +0.12.9 \ No newline at end of file diff --git a/DEV.md b/DEV.md index dd61bcb..339c479 100644 --- a/DEV.md +++ b/DEV.md @@ -20,15 +20,15 @@ scala-cli compile examples\scala-cli # RELEASE # bump publishVersion to x.y.z !!! $VERSION="0.8.1" -git commit --allow-empty -am "Release $VERSION" +git commit --allow-empty -m "Release $VERSION" git tag -a $VERSION -m "Release $VERSION" git push --atomic origin main --tags # prepare for NEXT version # bump publishVersion to x.y.z-SNAPSHOT -$VERSION="x.y.z-SNAPSHOT" -git commit -am"Bump version to $VERSION" +$VERSION="0.8.2-SNAPSHOT" +git commit -m"Bump version to $VERSION" ``` diff --git a/build.mill b/build.mill index 56ac144..31e73ef 100644 --- a/build.mill +++ b/build.mill @@ -4,7 +4,9 @@ import $ivy.`com.lihaoyi::mill-contrib-sonatypecentral:` import $ivy.`ba.sake::mill-hepek::0.1.0` import mill._ -import mill.scalalib._, scalafmt._, publish._ +import mill.scalalib._ +import mill.scalalib.scalafmt._ +import mill.scalalib.publish._ import mill.contrib.sonatypecentral.SonatypeCentralPublishModule import ba.sake.millhepek.MillHepekModule @@ -17,8 +19,8 @@ object sharaf extends SharafPublishModule { def ivyDeps = Agg( ivy"io.undertow:undertow-core:2.3.18.Final", ivy"com.lihaoyi::requests:0.9.0", - ivy"ba.sake::tupson:0.12.2", - ivy"ba.sake::tupson-config:0.12.2", + ivy"ba.sake::tupson:0.13.0", + ivy"ba.sake::tupson-config:0.13.0", ivy"ba.sake::hepek-components:0.29.1" ) diff --git a/sharaf/src/ba/sake/sharaf/handlers/SharafHandler.scala b/sharaf/src/ba/sake/sharaf/handlers/SharafHandler.scala index 7c0c6e8..4779faa 100644 --- a/sharaf/src/ba/sake/sharaf/handlers/SharafHandler.scala +++ b/sharaf/src/ba/sake/sharaf/handlers/SharafHandler.scala @@ -28,7 +28,10 @@ final class SharafHandler private ( routes, ResourceHandler( ClassPathResourceManager(getClass.getClassLoader, "public"), - RoutesHandler(notFoundRoutes) // handle 404s at the end + ResourceHandler( + ClassPathResourceManager(getClass.getClassLoader, "META-INF/resources/webjars"), + RoutesHandler(notFoundRoutes) // handle 404s at the end + ) ) ), corsSettings From 17dfca0f1ca803f99ea574c0863b880cc4adfc3a Mon Sep 17 00:00:00 2001 From: Sakib Hadziavdic Date: Mon, 24 Mar 2025 01:24:23 +0100 Subject: [PATCH 3/7] Improve gh actions --- .github/workflows/ci.yml | 3 ++- .github/workflows/release.yml | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d549d68..1f0666b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,7 @@ on: push: branches: main pull_request: + workflow_call: # allow this workflow to be called from other workflows jobs: test: @@ -13,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - java: [11, 17, 21] + java: [11, 21] steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0aa97df..6d70f26 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,7 @@ name: Release on: push: - tags: - - "*" + tags: "*" env: PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} @@ -11,8 +10,11 @@ env: SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} jobs: + tests: + uses: ./.github/workflows/ci.yml publish: runs-on: ubuntu-latest + needs: [tests] steps: - uses: actions/checkout@v4 with: From 4e766688d0cdfe5cd0a3a1ef6b49ec6c22b3e02a Mon Sep 17 00:00:00 2001 From: Sakib Hadziavdic Date: Mon, 24 Mar 2025 01:30:15 +0100 Subject: [PATCH 4/7] Use mill vcs version plugin --- build.mill | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/build.mill b/build.mill index 31e73ef..da10745 100644 --- a/build.mill +++ b/build.mill @@ -1,6 +1,7 @@ package build import $ivy.`com.lihaoyi::mill-contrib-sonatypecentral:` +import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.1` import $ivy.`ba.sake::mill-hepek::0.1.0` import mill._ @@ -8,9 +9,13 @@ import mill.scalalib._ import mill.scalalib.scalafmt._ import mill.scalalib.publish._ import mill.contrib.sonatypecentral.SonatypeCentralPublishModule +import de.tobiasroeser.mill.vcs.version.VcsVersion import ba.sake.millhepek.MillHepekModule -val sharafVersion = "0.8.2-SNAPSHOT" +object V { + val hepek = "0.30.0" + val tupson = "0.13.0" +} object sharaf extends SharafPublishModule { @@ -19,9 +24,9 @@ object sharaf extends SharafPublishModule { def ivyDeps = Agg( ivy"io.undertow:undertow-core:2.3.18.Final", ivy"com.lihaoyi::requests:0.9.0", - ivy"ba.sake::tupson:0.13.0", - ivy"ba.sake::tupson-config:0.13.0", - ivy"ba.sake::hepek-components:0.29.1" + ivy"ba.sake::tupson:${V.tupson}", + ivy"ba.sake::tupson-config:${V.tupson}", + ivy"ba.sake::hepek-components:${V.hepek}" ) def moduleDeps = Seq(querson, formson) @@ -74,7 +79,7 @@ object validson extends SharafPublishModule { trait SharafPublishModule extends SharafCommonModule with SonatypeCentralPublishModule { - def publishVersion = sharafVersion + def publishVersion = VcsVersion.vcsState().format() def pomSettings = PomSettings( organization = "ba.sake", @@ -137,7 +142,7 @@ object examples extends mill.Module { //////////////////// docs object docs extends MillHepekModule with SharafCommonModule { def ivyDeps = Agg( - ivy"ba.sake::hepek:0.25.0", + ivy"ba.sake::hepek:${V.hepek}", ivy"com.lihaoyi::os-lib:0.9.3" ) } From f41c3f33159d8cb2c741566b3f1f57503e8495ff Mon Sep 17 00:00:00 2001 From: Sakib Hadziavdic Date: Mon, 24 Mar 2025 01:32:58 +0100 Subject: [PATCH 5/7] Update DEV.md --- DEV.md | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/DEV.md b/DEV.md index 339c479..700c7ab 100644 --- a/DEV.md +++ b/DEV.md @@ -18,18 +18,11 @@ scala-cli compile examples\scala-cli ```sh # RELEASE -# bump publishVersion to x.y.z !!! -$VERSION="0.8.1" +$VERSION="0.8.2" git commit --allow-empty -m "Release $VERSION" git tag -a $VERSION -m "Release $VERSION" git push --atomic origin main --tags - -# prepare for NEXT version -# bump publishVersion to x.y.z-SNAPSHOT -$VERSION="0.8.2-SNAPSHOT" -git commit -m"Bump version to $VERSION" - ``` # TODOs @@ -37,9 +30,8 @@ git commit -m"Bump version to $VERSION" - MiMa bin compat - giter8 template for REST -- add more validators https://javaee.github.io/javaee-spec/javadocs/javax/validation/constraints/package-summary.html -- webjars +- add more validators https://javaee.github.io/javaee-spec/javadocs/javax/validation/constraints/package-summary.html README DEMO: From 59accb80230b426e74e4dd817602d89833109623 Mon Sep 17 00:00:00 2001 From: Sakib Hadziavdic Date: Mon, 24 Mar 2025 01:33:00 +0100 Subject: [PATCH 6/7] Release From 448cee067b643a8e48b12f8fce2fb001ae053976 Mon Sep 17 00:00:00 2001 From: Sakib Hadziavdic Date: Mon, 24 Mar 2025 01:33:11 +0100 Subject: [PATCH 7/7] Release 0.8.2