use rufio instead

This commit is contained in:
Mark Canlas 2022-12-01 08:17:33 -05:00
parent d4410bcde3
commit 8d908d9818
6 changed files with 17 additions and 23 deletions

View File

@ -13,6 +13,9 @@ on:
push:
branches: ['**']
env:
GH_PACKAGES_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}
jobs:
build:
name: Build and Test

View File

@ -19,3 +19,13 @@ lazy val scratchpad =
lazy val demo =
module("demo")
.withEfectMonad
.settings(libraryDependencies += "com.htmlism" %% "rufio-zio" % "71-5394aaef")
ThisBuild / resolvers += "mcanlas/rufio" at "https://maven.pkg.github.com/mcanlas/rufio/"
ThisBuild / credentials += Credentials(
"GitHub Package Registry",
"maven.pkg.github.com",
"mcanlas",
sys.env("GH_PACKAGES_TOKEN")
)

View File

@ -1,9 +0,0 @@
package com.htmlism.firepower.demo
import java.nio.file.Path
case class File(path: Path)
object File:
def apply(first: String, fragments: String*): File =
File(Path.of(first, fragments: _*))

View File

@ -4,6 +4,8 @@ import zio.*
import java.io.IOException
import com.htmlism.rufio.withzio._
object PrintPrograms extends ZIOAppDefault:
def run: ZIO[Any, Throwable, Unit] =
File("data/example.txt")

View File

@ -1,13 +0,0 @@
package com.htmlism.firepower
import java.nio.charset.Charset
import java.nio.file.Files
import zio.*
package object demo:
implicit class FileOps(f: demo.File):
def contents: Task[String] =
ZIO.attempt {
Files.readAllBytes(f.path)
}.map(xs => new String(xs, Charset.defaultCharset()))

View File

@ -1,4 +1,5 @@
import sbt._
import sbt.Keys._
import sbtghactions._
import sbtghactions.GenerativeKeys._
@ -17,7 +18,7 @@ object GitHubActionsSettings extends AutoPlugin {
override val buildSettings: Seq[Setting[_]] = Seq(
githubWorkflowBuild := Seq(WorkflowStep.Sbt(List("scalafmtCheck", "test"))),
githubWorkflowEnv := Map.empty,
githubWorkflowEnv := Map("GH_PACKAGES_TOKEN" -> "${{ secrets.GH_PACKAGES_TOKEN }}"),
githubWorkflowPublishTargetBranches := Nil,
githubWorkflowIncludeClean := false
)