Skip to content

Commit 87f0359

Browse files
committed
Added Github packages publishing (see README)
1 parent 267f0cf commit 87f0359

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ object Main extends App {
4040

4141
To set up Scala & SBT, use [Coursier](https://get-coursier.io/docs/cli-installation). After getting the `cs` executable, run `cs setup` and follow the prompt.
4242

43+
Compiling requires setting either the `GITHUB_TOKEN` environment variable, or a `github.token` Git configuration. Use `export GITHUB_TOKEN=<token>` or `git config --global github.token <token>`, where `<token>` can be generated in your GitHub account's [settings](https://github.com/settings/tokens).
44+
4345
### Testing
4446

4547
To run the tests, run `sbt test` in this README's directory.
@@ -62,7 +64,7 @@ cmake .. # Use loader flags as specified in https://github.com/metacall/core/blo
6264
sudo make install
6365
```
6466

65-
> You need to set `LOADER_LIBRARY_PATH` to the build directory created in the script above
67+
> You need to set `LOADER_LIBRARY_PATH` to the build directory created in the script above before running `sbt`, i.e. `LOADER_LIBRARY_PATH=path/to/core/build sbt`
6668
6769
To run the tests in Docker, run `sbt` then `docker` to build the image (must run `docker` from within the SBT session), and then `sbt dockerTest` to run it. Note that you should build the `metacall/core:dev` image locally since the published one might not be up to date by running `./docker-compose.sh build` in `metacall/core`'s root. Pay attention to SBT's error messages.
6870

@@ -87,3 +89,7 @@ Then copy the classpath into the valgrind command:
8789
```
8890
valgrind --tool=memcheck --trace-children=yes --error-limit=no scala -Djava.compiler=NONE -cp <classpath> src/test/scala/MetaCallSpecMain.scala
8991
```
92+
93+
# Publishing
94+
95+
Use `sbt publish` to publish to GitHub Packages using [sbt-github-packages](https://github.com/djspiewak/sbt-github-packages). Make sure your GitHub token is set correctly according to [Setup](#setup).

build.sbt

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import Tests._
22

33
lazy val commonSettings = Seq(
4-
name := "metacall",
4+
name := "metacall-scala",
55
scalaVersion := "2.13.4",
6-
version := "0.1.0-SNAPSHOT",
7-
organization := "com.metacall",
8-
organizationName := "metacall",
6+
version := "0.1.0",
7+
organization := "io.metacall",
8+
organizationName := "MetaCall",
99
scalacOptions ++= Seq(
1010
// Only for debugging purposes
1111
// "-Djava.compiler=NONE",
@@ -58,6 +58,12 @@ lazy val root = (project in file("."))
5858
testGrouping in Test := (testGrouping in Test).value.flatMap { group =>
5959
group.tests map (test => Group(test.name, Seq(test), SubProcess(ForkOptions())))
6060
},
61+
githubSuppressPublicationWarning := true,
62+
githubOwner := "metacall",
63+
githubRepository := "core",
64+
githubTokenSource :=
65+
TokenSource.Environment("GITHUB_TOKEN") ||
66+
TokenSource.GitConfig("github.token"),
6167
dockerfile in docker := new Dockerfile {
6268
from("metacall/core:dev")
6369

project/plugins.sbt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.8.2")
1+
addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.8.2")
2+
addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.2")

src/main/scala/Ptr.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import com.sun.jna._
44
import metacall.util._
55
import concurrent.Future
66

7-
/** Create a [[Ptr]] to MetaCall value of type [[A]] */
7+
/** Create a [[Ptr]] to MetaCall value of type `A` */
88
trait Create[A] {
99
def create(value: A): Ptr[A]
1010
}

0 commit comments

Comments
 (0)