Skip to content

Commit

Permalink
Merge branch 'main' into update/laika-sbt-0.19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
armanbilge authored Oct 12, 2022
2 parents e38267c + 27edee4 commit 4a7fe6d
Show file tree
Hide file tree
Showing 36 changed files with 911 additions and 490 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{scala,sbt}]
indent_style = space
indent_size = 2
137 changes: 102 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ on:
tags: [v*]

env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
Expand All @@ -30,25 +25,25 @@ jobs:
os: [ubuntu-latest]
scala: [2.12.17]
java: [temurin@8, temurin@17]
project: [rootJVM]
project: [sbt-typelevelJVM]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Download Java (temurin@8)
id: download-java-temurin-8
if: matrix.java == 'temurin@8'
uses: typelevel/download-java@v1
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 8

- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 8
Expand All @@ -57,21 +52,21 @@ jobs:
- name: Download Java (temurin@17)
id: download-java-temurin-17
if: matrix.java == 'temurin@17'
uses: typelevel/download-java@v1
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 17

- name: Setup Java (temurin@17)
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 17
jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }}

- name: Cache sbt
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.sbt
Expand Down Expand Up @@ -105,24 +100,24 @@ jobs:
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' doc

- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/series/0.4')
run: mkdir -p github/target github-actions/target kernel/target versioning/target ci-release/target scalafix/target target .js/target mdocs/target site/target ci-signing/target mergify/target unidoc/target mima/target .jvm/target .native/target no-publish/target sonatype/target ci/target sonatype-ci-release/target core/target settings/target project/target
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
run: mkdir -p github/target github-actions/target kernel/target versioning/target ci-release/target scalafix/target .jvm/target mdocs/target site/target ci-signing/target mergify/target unidoc/target .native/target mima/target no-publish/target sonatype/target ci/target sonatype-ci-release/target core/target settings/target target .js/target project/target

- name: Compress target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/series/0.4')
run: tar cf targets.tar github/target github-actions/target kernel/target versioning/target ci-release/target scalafix/target target .js/target mdocs/target site/target ci-signing/target mergify/target unidoc/target mima/target .jvm/target .native/target no-publish/target sonatype/target ci/target sonatype-ci-release/target core/target settings/target project/target
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
run: tar cf targets.tar github/target github-actions/target kernel/target versioning/target ci-release/target scalafix/target .jvm/target mdocs/target site/target ci-signing/target mergify/target unidoc/target .native/target mima/target no-publish/target sonatype/target ci/target sonatype-ci-release/target core/target settings/target target .js/target project/target

- name: Upload target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/series/0.4')
uses: actions/upload-artifact@v2
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
uses: actions/upload-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }}
path: targets.tar

publish:
name: Publish Artifacts
needs: [build]
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/series/0.4')
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
strategy:
matrix:
os: [ubuntu-latest]
Expand All @@ -131,21 +126,21 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Download Java (temurin@8)
id: download-java-temurin-8
if: matrix.java == 'temurin@8'
uses: typelevel/download-java@v1
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 8

- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 8
Expand All @@ -154,21 +149,21 @@ jobs:
- name: Download Java (temurin@17)
id: download-java-temurin-17
if: matrix.java == 'temurin@17'
uses: typelevel/download-java@v1
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 17

- name: Setup Java (temurin@17)
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 17
jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }}

- name: Cache sbt
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.sbt
Expand All @@ -179,30 +174,102 @@ jobs:
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Download target directories (2.12.17, rootJVM)
uses: actions/download-artifact@v2
- name: Download target directories (2.12.17, sbt-typelevelJVM)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-rootJVM
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-sbt-typelevelJVM

- name: Inflate target directories (2.12.17, rootJVM)
- name: Inflate target directories (2.12.17, sbt-typelevelJVM)
run: |
tar xf targets.tar
rm targets.tar
- name: Import signing key
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
run: echo $PGP_SECRET | base64 -di | gpg --import

- name: Import signing key and strip passphrase
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
run: |
echo "$PGP_SECRET" | base64 -di > /tmp/signing-key.gpg
echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
(echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1)
- name: Publish
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
run: sbt '++${{ matrix.scala }}' tlRelease

dependency-submission:
name: Submit Dependencies
if: github.event_name != 'pull_request'
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.17]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Download Java (temurin@8)
id: download-java-temurin-8
if: matrix.java == 'temurin@8'
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 8

- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 8
jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }}

- name: Download Java (temurin@17)
id: download-java-temurin-17
if: matrix.java == 'temurin@17'
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 17

- name: Setup Java (temurin@17)
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 17
jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }}

- name: Cache sbt
uses: actions/cache@v3
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
~/AppData/Local/Coursier/Cache/v1
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Submit Dependencies
uses: scalacenter/sbt-dependency-submission@v2

site:
name: Generate Site
strategy:
Expand All @@ -213,21 +280,21 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Download Java (temurin@8)
id: download-java-temurin-8
if: matrix.java == 'temurin@8'
uses: typelevel/download-java@v1
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 8

- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 8
Expand All @@ -236,21 +303,21 @@ jobs:
- name: Download Java (temurin@17)
id: download-java-temurin-17
if: matrix.java == 'temurin@17'
uses: typelevel/download-java@v1
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 17

- name: Setup Java (temurin@17)
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 17
jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }}

- name: Cache sbt
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.sbt
Expand Down
4 changes: 2 additions & 2 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ pull_request_rules:
- or:
- body~=labels:.*early-semver-patch
- body~=labels:.*early-semver-minor
- status-success=Build and Test (ubuntu-latest, 2.12.17, temurin@8, rootJVM)
- status-success=Build and Test (ubuntu-latest, 2.12.17, temurin@17, rootJVM)
- status-success=Build and Test (ubuntu-latest, 2.12.17, temurin@8, sbt-typelevelJVM)
- status-success=Build and Test (ubuntu-latest, 2.12.17, temurin@17, sbt-typelevelJVM)
- '#approved-reviews-by>=1'
actions:
merge: {}
Expand Down
13 changes: 8 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name := "sbt-typelevel"

ThisBuild / tlBaseVersion := "0.4"
ThisBuild / tlCiReleaseBranches := Seq("series/0.4")
ThisBuild / tlBaseVersion := "0.5"
ThisBuild / tlSitePublishBranch := Some("series/0.4")
ThisBuild / crossScalaVersions := Seq("2.12.17")
ThisBuild / developers := List(
ThisBuild / developers ++= List(
tlGitHubDev("armanbilge", "Arman Bilge"),
tlGitHubDev("rossabaker", "Ross A. Baker"),
tlGitHubDev("ChristopherDavenport", "Christopher Davenport"),
Expand All @@ -30,7 +29,9 @@ ThisBuild / scalafixDependencies ++= Seq(
"com.github.liancheng" %% "organize-imports" % "0.6.0"
)

lazy val root = tlCrossRootProject.aggregate(
val MunitVersion = "0.7.29"

lazy val `sbt-typelevel` = tlCrossRootProject.aggregate(
kernel,
noPublish,
settings,
Expand All @@ -55,7 +56,8 @@ lazy val kernel = project
.in(file("kernel"))
.enablePlugins(SbtPlugin)
.settings(
name := "sbt-typelevel-kernel"
name := "sbt-typelevel-kernel",
libraryDependencies += "org.scalameta" %% "munit" % MunitVersion % Test
)

lazy val noPublish = project
Expand Down Expand Up @@ -210,6 +212,7 @@ lazy val docs = project
"Laika" -> url("https://planet42.github.io/Laika/"),
"sbt-unidoc" -> url("https://github.com/sbt/sbt-unidoc")
),
tlSiteIsTypelevelProject := true,
mdocVariables ++= {
import coursier.complete.Complete
import java.time._
Expand Down
Loading

0 comments on commit 4a7fe6d

Please sign in to comment.