Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 21 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,42 @@
name: CI

on:
pull_request:
branches: ["*"]
push:
branches: ["main"]
tags: ["v*"]
pull_request:
branches: ["*"]

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: coursier/cache-action@v6
- uses: VirtusLab/scala-cli-setup@main
with:
power: true

- name: Check formatting
run: make code-check || echo "Run `make pre-ci`"

- name: Test
run: make test
- uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "21"
cache: "sbt"

- name: Check documentation compiles and runs
run: make check-docs && make run-example
- name: Setup sbt
uses: sbt/setup-sbt@v1

- name: Publish snapshot
if: github.ref == 'refs/heads/main'
run: make publish-snapshot
env:
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
- name: Test
run: sbt ci

- name: Publish
if: startsWith(github.ref, 'refs/tags/v')
run: make publish
- name: Publish ${{ github.ref }}
# todo: uncomment
# if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || (github.ref == 'refs/heads/main'))
run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

5 changes: 0 additions & 5 deletions .github/workflows/import-gpg.sh

This file was deleted.

5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,8 @@ dist-ssr
.metals
.bsp
scalajs-frontend.js

# sbt
target/
project/target/
project/project/
1 change: 1 addition & 0 deletions .sbtopts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-J-Xmx6g
23 changes: 0 additions & 23 deletions Makefile

This file was deleted.

85 changes: 85 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import org.typelevel.sbt.tpolecat.DevMode

import java.net.URI

inThisBuild(
List(
organization := "tech.neander",
homepage := Some(url("https://github.com/neandertech/smithy4s-fetch")),
licenses := List(License.Apache2),
developers := List(
Developer(
"velvetbaldmime",
"Anton Sviridov",
"contact@indoorvivants.com",
URI.create("https://indoorvivants.com").toURL
)
)
)
)

val scala213 = "2.13.18"
val scala3 = "3.3.7"
val scalaNext = "3.8.2"
val allScalaVersions = List(scala213, scala3)

val smithy4sVersion = "0.18.48"
val http4sVersion = "0.23.33"
val weaverVersion = "0.8.4"

ThisBuild / versionScheme := Some("early-semver")
ThisBuild / tpolecatOptionsMode := DevMode

val commonSettings = Seq(
mimaPreviousArtifacts := Set.empty
)

val fetch = projectMatrix
.in(file("modules") / "fetch")
.jsPlatform(allScalaVersions)
.settings(
name := "smithy4s-fetch",
commonSettings,
libraryDependencies ++= Seq(
"com.disneystreaming.smithy4s" %%% "smithy4s-core" % smithy4sVersion,
"com.disneystreaming.smithy4s" %%% "smithy4s-json" % smithy4sVersion,
"org.scala-js" %%% "scalajs-dom" % "2.8.1"
),
libraryDependencies ++= Seq(
"com.disneystreaming" %%% "weaver-cats" % weaverVersion % Test
)
)

val tests =
projectMatrix
.in(file("modules") / "tests")
.settings(publish / skip := true)
.disablePlugins(MimaPlugin)
.dependsOn(fetch)
// Hacky way to make projectmatrix work: we pretend to use scala3LTS, but we override it later
.jsPlatform(List(scala3))
.settings(
scalaVersion := scalaNext,
libraryDependencies ++=
Seq(
"com.disneystreaming" %%% "weaver-cats" % weaverVersion % Test,
"tech.neander" %%% "smithy4s-deriving" % "0.0.3" % Test,
"com.disneystreaming.smithy4s" %%% "smithy4s-http4s" % smithy4sVersion % Test,
"org.http4s" %%% "http4s-ember-server" % http4sVersion % Test,
"org.http4s" %%% "http4s-ember-client" % http4sVersion % Test
),
scalaJSLinkerConfig ~= {
_.withModuleKind(org.scalajs.linker.interface.ModuleKind.ESModule)
}
)

val root = project
.in(file("."))
.settings(publish / skip := true)
.disablePlugins(MimaPlugin)
.aggregate(List(fetch, tests).flatMap(_.projectRefs): _*)

addCommandAlias(
"ci",
"compile;test;scalafmtCheckAll;mimaReportBinaryIssues"
)
Loading
Loading