You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "mdedetrich (via GitHub)" <gi...@apache.org> on 2024/02/14 22:19:56 UTC

[PR] Target JDK 1.8 and use sbt-github-actions for snapshot publish [incubator-pekko-sbt-paradox]

mdedetrich opened a new pull request, #97:
URL: https://github.com/apache/incubator-pekko-sbt-paradox/pull/97

   This PR does 2 things, the first is it makes the project target JDK 1.8 and the second is that it makes the publish step be generated by sbt-github-actions rather than manually.
   
   First thing to note is that even though this project is being changed to target JDK 1.8 (which is actually what we use to generate docs currently) its still perfectly possible to use the exact same binary with JDK 11+, you just need to add the newer sbt-paradox/sbt-paradox-theme versions (see https://github.com/sbt/sbt-paradox-material-theme/blob/main/src/main/paradox/getting-started.md#getting-started for more info). Note that it is actually intended that sbt-paradox-material-theme will continue targeting JDK 1.8/sbt-paradox 0.9.2 until its actually forced to update the version of sbt-paradox (i.e. sbt-paradox/sbt-paradox-theme will add some incompatible API which sbt-paradox-material-theme will need to use).
   
   Changing the build to target JDK 1.8 was necessary in order to use sbt-github-actions to handle publishing (before this was a manual github workflow file). This is because sbt-github-actions uses the first value of `githubWorkflowJavaVersions` for publishing and since sbt-paradox 0.10.6 **ONLY** works with JDK 11+ it makes sense to both test for JDK 1.8 and use JDK 1.8 for publishing.
   
   tl;dr
   - Project was changed to target JDK 1.8 but it will have no impact if projects that want to use JDK 11+, they just need to follow [these instructions](https://github.com/sbt/sbt-paradox-material-theme/blob/main/src/main/paradox/getting-started.md#getting-started)
   - sbt-github-actions will now also handle snapshot publishing, it will however not pubish when tags are pushed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Target JDK 1.8 and use sbt-github-actions for snapshot publish [incubator-pekko-sbt-paradox]

Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich merged PR #97:
URL: https://github.com/apache/incubator-pekko-sbt-paradox/pull/97


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Target JDK 1.8 and use sbt-github-actions for snapshot publish [incubator-pekko-sbt-paradox]

Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich commented on code in PR #97:
URL: https://github.com/apache/incubator-pekko-sbt-paradox/pull/97#discussion_r1490146331


##########
.github/workflows/ci.yml:
##########
@@ -45,33 +45,79 @@ jobs:
         with:
           fetch-depth: 0
 
-      - name: Setup Java (temurin@11)
-        if: matrix.java == 'temurin@11'
+      - name: Setup Java (temurin@8)
+        if: matrix.java == 'temurin@8'
         uses: actions/setup-java@v4
         with:
           distribution: temurin
-          java-version: 11
+          java-version: 8
           cache: sbt
 
-      - name: Setup Java (temurin@17)
-        if: matrix.java == 'temurin@17'
-        uses: actions/setup-java@v4
+      - name: Check that workflows are up to date
+        shell: bash
+        run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck
+
+      - shell: bash
+        run: sbt '++ ${{ matrix.scala }}' test scripted
+
+      - name: Compress target directories
+        shell: bash
+        run: tar cf targets.tar target theme/target plugin/target project/target
+
+      - name: Upload target directories
+        uses: actions/upload-artifact@v4
         with:
-          distribution: temurin
-          java-version: 17
-          cache: sbt
+          name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
+          path: targets.tar
+
+  publish:
+    name: Publish Artifacts
+    needs: [build]
+    if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main')
+    strategy:
+      matrix:
+        os: [ubuntu-latest]
+        scala: [2.12.18]
+        java: [temurin@8]
+    runs-on: ${{ matrix.os }}
+    steps:
+      - name: Ignore line ending differences in git
+        if: contains(runner.os, 'windows')
+        run: git config --global core.autocrlf false
 
-      - name: Setup Java (temurin@21)
-        if: matrix.java == 'temurin@21'
+      - name: Configure pagefile for Windows
+        if: contains(runner.os, 'windows')
+        uses: al-cheb/configure-pagefile-action@v1.4

Review Comment:
   This is just making sure that the plugin can be built on windows for people such as @He-Pin . The specific code you are pointing out is a workaround for how windows handles page files (tl;dr due to limited resources of github actions runners its possible to run out of memory specifically for windows).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Target JDK 1.8 and use sbt-github-actions for snapshot publish [incubator-pekko-sbt-paradox]

Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich commented on code in PR #97:
URL: https://github.com/apache/incubator-pekko-sbt-paradox/pull/97#discussion_r1490136304


##########
build.sbt:
##########
@@ -88,12 +91,18 @@ lazy val pekkoPlugin = project
 ThisBuild / githubWorkflowBuild := Seq(WorkflowStep.Sbt(List("test", "scripted")))
 
 ThisBuild / githubWorkflowTargetTags ++= Seq("v*")
-ThisBuild / githubWorkflowPublishTargetBranches := Seq()
-ThisBuild / githubWorkflowPublish := Seq()
+ThisBuild / githubWorkflowPublishTargetBranches := Seq(
+  RefPredicate.Equals(Ref.Branch("main")))

Review Comment:
   This ensures that we only run `+publish` when a PR is merged into main, i.e. snapshots (see https://github.com/sbt/sbt-github-actions?tab=readme-ov-file#integration-with-sbt-ci-release for instructions).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Target JDK 1.8 and use sbt-github-actions for snapshot publish [incubator-pekko-sbt-paradox]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #97:
URL: https://github.com/apache/incubator-pekko-sbt-paradox/pull/97#discussion_r1490140842


##########
.github/workflows/ci.yml:
##########
@@ -45,33 +45,79 @@ jobs:
         with:
           fetch-depth: 0
 
-      - name: Setup Java (temurin@11)
-        if: matrix.java == 'temurin@11'
+      - name: Setup Java (temurin@8)
+        if: matrix.java == 'temurin@8'
         uses: actions/setup-java@v4
         with:
           distribution: temurin
-          java-version: 11
+          java-version: 8
           cache: sbt
 
-      - name: Setup Java (temurin@17)
-        if: matrix.java == 'temurin@17'
-        uses: actions/setup-java@v4
+      - name: Check that workflows are up to date
+        shell: bash
+        run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck
+
+      - shell: bash
+        run: sbt '++ ${{ matrix.scala }}' test scripted
+
+      - name: Compress target directories
+        shell: bash
+        run: tar cf targets.tar target theme/target plugin/target project/target
+
+      - name: Upload target directories
+        uses: actions/upload-artifact@v4
         with:
-          distribution: temurin
-          java-version: 17
-          cache: sbt
+          name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
+          path: targets.tar
+
+  publish:
+    name: Publish Artifacts
+    needs: [build]
+    if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main')
+    strategy:
+      matrix:
+        os: [ubuntu-latest]
+        scala: [2.12.18]
+        java: [temurin@8]
+    runs-on: ${{ matrix.os }}
+    steps:
+      - name: Ignore line ending differences in git
+        if: contains(runner.os, 'windows')
+        run: git config --global core.autocrlf false
 
-      - name: Setup Java (temurin@21)
-        if: matrix.java == 'temurin@21'
+      - name: Configure pagefile for Windows
+        if: contains(runner.os, 'windows')
+        uses: al-cheb/configure-pagefile-action@v1.4

Review Comment:
   why all this windows stuff? not a blocker



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Target JDK 1.8 and use sbt-github-actions for snapshot publish [incubator-pekko-sbt-paradox]

Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich commented on code in PR #97:
URL: https://github.com/apache/incubator-pekko-sbt-paradox/pull/97#discussion_r1490137035


##########
build.sbt:
##########
@@ -88,12 +91,18 @@ lazy val pekkoPlugin = project
 ThisBuild / githubWorkflowBuild := Seq(WorkflowStep.Sbt(List("test", "scripted")))
 
 ThisBuild / githubWorkflowTargetTags ++= Seq("v*")
-ThisBuild / githubWorkflowPublishTargetBranches := Seq()
-ThisBuild / githubWorkflowPublish := Seq()
+ThisBuild / githubWorkflowPublishTargetBranches := Seq(
+  RefPredicate.Equals(Ref.Branch("main")))
+
+ThisBuild / githubWorkflowPublish := Seq(

Review Comment:
   This is exactly the same as the original `publish.yml`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org