diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 873a372..f8b3f1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,13 +12,14 @@ on: branches: ['**'] push: branches: ['**'] - tags: [v*, v*] + tags: [v*] env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} PGP_SECRET: ${{ secrets.PGP_SECRET }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: build: @@ -27,7 +28,7 @@ jobs: matrix: os: [ubuntu-latest] scala: [2.12.15, 2.13.8, 3.0.2] - java: [adopt@1.8] + java: [temurin@8] runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) @@ -35,10 +36,12 @@ jobs: with: fetch-depth: 0 - - name: Setup Java and Scala - uses: olafurpg/setup-scala@v13 + - name: Setup Java (temurin@8) + if: matrix.java == 'temurin@8' + uses: actions/setup-java@v2 with: - java-version: ${{ matrix.java }} + distribution: temurin + java-version: 8 - name: Cache sbt uses: actions/cache@v2 @@ -69,6 +72,9 @@ jobs: - if: matrix.scala == '2.13.8' run: sbt ++${{ matrix.scala }} ++2.13.8 site/makeMicrosite + - name: Make target directories + run: mkdir -p testing/.jvm/target core/.js/target testing/.js/target core/.jvm/target tests/js/target tests/jvm/target target bench/target project/target + - name: Compress target directories run: tar cf targets.tar testing/.jvm/target core/.js/target testing/.js/target core/.jvm/target tests/js/target tests/jvm/target target bench/target project/target @@ -81,12 +87,12 @@ jobs: publish: name: Publish Artifacts needs: [build] - if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v')) + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') strategy: matrix: os: [ubuntu-latest] - scala: [2.13.8] - java: [adopt@1.8] + scala: [3.0.2] + java: [temurin@8] runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) @@ -94,10 +100,12 @@ jobs: with: fetch-depth: 0 - - name: Setup Java and Scala - uses: olafurpg/setup-scala@v13 + - name: Setup Java (temurin@8) + if: matrix.java == 'temurin@8' + uses: actions/setup-java@v2 with: - java-version: ${{ matrix.java }} + distribution: temurin + java-version: 8 - name: Cache sbt uses: actions/cache@v2 @@ -142,8 +150,16 @@ jobs: rm targets.tar - name: Import signing key + if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == '' run: echo $PGP_SECRET | base64 -d | gpg --import + - name: Import signing key and strip passphrase + if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != '' + run: | + echo "$PGP_SECRET" | base64 -d > /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) + - run: sbt ++${{ matrix.scala }} release - run: | diff --git a/.scalafmt.conf b/.scalafmt.conf index 16a4641..4cefc1e 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,5 +1,7 @@ version = 3.3.1 +runner.dialect = Scala213Source3 + style = default maxColumn = 100 diff --git a/bench/src/main/scala/com/rossabaker/ci/bench/CIStringBench.scala b/bench/src/main/scala/com/rossabaker/ci/bench/CIStringBench.scala index e2a801e..72c90be 100644 --- a/bench/src/main/scala/com/rossabaker/ci/bench/CIStringBench.scala +++ b/bench/src/main/scala/com/rossabaker/ci/bench/CIStringBench.scala @@ -1,7 +1,17 @@ /* * Copyright 2020 Typelevel * - * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.typelevel.ci diff --git a/build.sbt b/build.sbt index fd9c5b1..8febcbf 100644 --- a/build.sbt +++ b/build.sbt @@ -6,7 +6,9 @@ val catsV = "2.7.0" val scalacheckV = "1.15.4" val disciplineMunitV = "1.0.9" -enablePlugins(SonatypeCiReleasePlugin) +ThisBuild / tlVersionIntroduced := Map( + "3" -> "1.1.4" +) // Projects lazy val `case-insensitive` = project @@ -17,24 +19,16 @@ lazy val `case-insensitive` = project lazy val core = crossProject(JSPlatform, JVMPlatform) .crossType(CrossType.Pure) .in(file("core")) - .settings(commonSettings) .settings( name := "case-insensitive", libraryDependencies ++= Seq( "org.typelevel" %%% "cats-core" % catsV - ), - Compile / unmanagedSourceDirectories ++= { - val major = if (isDotty.value) "-3" else "-2" - List(CrossType.Pure, CrossType.Full).flatMap( - _.sharedSrcDir(baseDirectory.value, "main").toList.map(f => file(f.getPath + major)) - ) - } + ) ) lazy val testing = crossProject(JSPlatform, JVMPlatform) .crossType(CrossType.Pure) .in(file("testing")) - .settings(commonSettings) .settings( name := "case-insensitive-testing", libraryDependencies ++= Seq( @@ -50,7 +44,6 @@ lazy val tests = crossProject(JSPlatform, JVMPlatform) .crossType(CrossType.Full) .in(file("tests")) .enablePlugins(NoPublishPlugin) - .settings(commonSettings) .settings( name := "case-insensitive-tests", libraryDependencies ++= Seq( @@ -78,7 +71,6 @@ lazy val bench = project .in(file("bench")) .enablePlugins(NoPublishPlugin) .enablePlugins(JmhPlugin) - .settings(commonSettings) .settings( name := "case-insensitive-bench" ) @@ -89,7 +81,6 @@ lazy val site = project .enablePlugins(MicrositesPlugin) .enablePlugins(MdocPlugin) .enablePlugins(NoPublishPlugin) - .settings(commonSettings) .dependsOn(core.jvm, testing.jvm) .settings { import microsites._ @@ -129,38 +120,16 @@ lazy val site = project ), } -// General Settings -lazy val commonSettings = Seq( - headerLicenseStyle := HeaderLicenseStyle.SpdxSyntax -) ++ automateHeaderSettings(Compile, Test) - val Scala213 = "2.13.8" val Scala213Cond = s"matrix.scala == '$Scala213'" // General Settings inThisBuild( List( - organization := "org.typelevel", - organizationName := "Typelevel", - publishGithubUser := "rossabaker", - publishFullName := "Ross A. Baker", - baseVersion := "1.1", + tlBaseVersion := "1.2", crossScalaVersions := Seq("2.12.15", Scala213, "3.0.2"), - scalaVersion := crossScalaVersions.value.filter(_.startsWith("2.")).last, - versionIntroduced := Map( - "3.0.0-RC1" -> "1.0.0", - "3.0.0-RC2" -> "1.0.1", - "3.0.0-RC3" -> "1.1.3" - ), - homepage := Some(url("https://github.com/typelevel/case-insensitive")), + homepage := Some(url("https://typelevel.org/case-insensitive")), startYear := Some(2020), - licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")), - scmInfo := Some( - ScmInfo( - url("https://github.com/typelevel/case-insensitive"), - "git@github.com:typelevel/case-insensitive.git")), - githubWorkflowTargetTags ++= Seq("v*"), - githubWorkflowPublishTargetBranches := Seq(RefPredicate.StartsWith(Ref.Tag("v"))), githubWorkflowBuildPreamble ++= Seq( WorkflowStep .Use(UseRef.Public("actions", "setup-ruby", "v1"), params = Map("ruby-version" -> "2.7")), diff --git a/core/src/main/scala-2.12/org/typelevel/ci/compat.scala b/core/src/main/scala-2.12/org/typelevel/ci/compat.scala index 94fd041..b594d80 100644 --- a/core/src/main/scala-2.12/org/typelevel/ci/compat.scala +++ b/core/src/main/scala-2.12/org/typelevel/ci/compat.scala @@ -1,7 +1,17 @@ /* * Copyright 2020 Typelevel * - * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.typelevel.ci diff --git a/core/src/main/scala-2.13/org/typelevel/ci/compat.scala b/core/src/main/scala-2.13/org/typelevel/ci/compat.scala index f309eb1..d4dd4d0 100644 --- a/core/src/main/scala-2.13/org/typelevel/ci/compat.scala +++ b/core/src/main/scala-2.13/org/typelevel/ci/compat.scala @@ -1,7 +1,17 @@ /* * Copyright 2020 Typelevel * - * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.typelevel.ci diff --git a/core/src/main/scala-3/org/typelevel/ci/compat.scala b/core/src/main/scala-3/org/typelevel/ci/compat.scala index f309eb1..d4dd4d0 100644 --- a/core/src/main/scala-3/org/typelevel/ci/compat.scala +++ b/core/src/main/scala-3/org/typelevel/ci/compat.scala @@ -1,7 +1,17 @@ /* * Copyright 2020 Typelevel * - * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.typelevel.ci diff --git a/core/src/main/scala/org/typelevel/ci/CIString.scala b/core/src/main/scala/org/typelevel/ci/CIString.scala index 0e98cb8..13710be 100644 --- a/core/src/main/scala/org/typelevel/ci/CIString.scala +++ b/core/src/main/scala/org/typelevel/ci/CIString.scala @@ -1,7 +1,17 @@ /* * Copyright 2020 Typelevel * - * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.typelevel.ci diff --git a/core/src/main/scala/org/typelevel/ci/package.scala b/core/src/main/scala/org/typelevel/ci/package.scala index 19b542d..5f3e4cd 100644 --- a/core/src/main/scala/org/typelevel/ci/package.scala +++ b/core/src/main/scala/org/typelevel/ci/package.scala @@ -1,7 +1,17 @@ /* * Copyright 2020 Typelevel * - * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.typelevel diff --git a/project/build.sbt b/project/build.sbt new file mode 100644 index 0000000..7719321 --- /dev/null +++ b/project/build.sbt @@ -0,0 +1 @@ +resolvers += Resolver.sonatypeRepo("snapshots") diff --git a/project/plugins.sbt b/project/plugins.sbt index 8f2bc26..9a10900 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,6 @@ addSbtPlugin("com.47deg" % "sbt-microsites" % "1.3.4") -addSbtPlugin("com.codecommit" % "sbt-spiewak-sonatype" % "0.22.1") +addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.4.0-M3") +addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0") addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.24") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3") diff --git a/testing/src/main/scala/org/typelevel/ci/testing/arbitraries.scala b/testing/src/main/scala/org/typelevel/ci/testing/arbitraries.scala index 08e1ac7..c7ea175 100644 --- a/testing/src/main/scala/org/typelevel/ci/testing/arbitraries.scala +++ b/testing/src/main/scala/org/typelevel/ci/testing/arbitraries.scala @@ -1,7 +1,17 @@ /* * Copyright 2020 Typelevel * - * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.typelevel.ci diff --git a/tests/jvm/src/test/scala/org/typelevel/ci/CIStringJVMSuite.scala b/tests/jvm/src/test/scala/org/typelevel/ci/CIStringJVMSuite.scala index 4cfb95a..25612d6 100644 --- a/tests/jvm/src/test/scala/org/typelevel/ci/CIStringJVMSuite.scala +++ b/tests/jvm/src/test/scala/org/typelevel/ci/CIStringJVMSuite.scala @@ -1,7 +1,17 @@ /* * Copyright 2020 Typelevel * - * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.typelevel.ci diff --git a/tests/shared/src/test/scala/org/typelevel/ci/CIStringSuite.scala b/tests/shared/src/test/scala/org/typelevel/ci/CIStringSuite.scala index 412632b..a28087e 100644 --- a/tests/shared/src/test/scala/org/typelevel/ci/CIStringSuite.scala +++ b/tests/shared/src/test/scala/org/typelevel/ci/CIStringSuite.scala @@ -1,7 +1,17 @@ /* * Copyright 2020 Typelevel * - * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.typelevel.ci @@ -22,7 +32,7 @@ class CIStringSuite extends DisciplineSuite { } } - property("character based equality") { + test("character based equality") { assert(CIString("ß") != CIString("SS")) } diff --git a/tests/shared/src/test/scala/org/typelevel/ci/TurkeySuite.scala b/tests/shared/src/test/scala/org/typelevel/ci/TurkeySuite.scala index b45f08e..bbb9347 100644 --- a/tests/shared/src/test/scala/org/typelevel/ci/TurkeySuite.scala +++ b/tests/shared/src/test/scala/org/typelevel/ci/TurkeySuite.scala @@ -1,7 +1,17 @@ /* * Copyright 2020 Typelevel * - * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.typelevel.ci