Skip to content

Commit

Permalink
Make the project a simple library (#1)
Browse files Browse the repository at this point in the history
Earlier versions of that code in the Scala CLI build relied on Mill tasks
working directory, but it doesn't any more, so we don't need to use the
Mill task system here
  • Loading branch information
alexarchambault committed May 2, 2023
1 parent 5cab7d2 commit 1268264
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 552 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# originally based on https://github.com/alexarchambault/mill-native-image/blob/dca83cef17f1a90360b62610e1dcce57271ef37d/.github/workflows/ci.yml

name: CI
on:
push:
Expand All @@ -21,11 +19,12 @@ jobs:
- uses: coursier/setup-action@v1
with:
jvm: 8
apps: "scala-cli"
- name: Test
run: ./mill __.test
run: scala-cli --power test . --cross

publish:
if: github.event_name == 'push' && github.repository == 'coursier/mill-cs'
if: github.event_name == 'push' && github.repository == 'coursier/get-cs'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -36,12 +35,14 @@ jobs:
- uses: coursier/setup-action@v1
with:
jvm: 8
apps: "scala-cli"
- run: .github/scripts/gpg-setup.sh
env:
PGP_SECRET: ${{ secrets.PUBLISH_SECRET_KEY }}
PUBLISH_SECRET_KEY: ${{ secrets.PUBLISH_SECRET_KEY }}
- name: Release
run: ./mill publishSonatype __.publishArtifacts
run: scala-cli --power publish . --cross
env:
PGP_PASSPHRASE: ${{ secrets.PUBLISH_SECRET_KEY_PASSWORD }}
SONATYPE_PASSWORD: ${{ secrets.PUBLISH_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.PUBLISH_USER }}
PUBLISH_SECRET_KEY: ${{ secrets.PUBLISH_SECRET_KEY }}
PUBLISH_SECRET_KEY_PASSWORD: ${{ secrets.PUBLISH_SECRET_KEY_PASSWORD }}
PUBLISH_USER: ${{ secrets.PUBLISH_USER }}
PUBLISH_PASSWORD: ${{ secrets.PUBLISH_PASSWORD }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
out/
.scala-build/
.bsp/
.metals/
.vscode/
Expand Down
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
# mill-cs
# get-cs

A Mill plugin to fetch a [coursier](https://github.com/coursier/coursier) from Mill
A library to fetch a [coursier](https://github.com/coursier/coursier) from Scala code

This plugin fetches native coursier launcher, depending on your OS (Linux / macOS /
This library fetches a native coursier launcher, depending on your OS (Linux / macOS /
Windows) and architecture (x86-64 / ARM64), and falls back to any launcher
available in the `PATH` in unsupported OSes or architectures.

Use like
```scala
import $ivy.`io.get-coursier.mill::mill-cs::0.1.0`
import coursier.mill.MillCs
//> using lib "io.get-coursier.util:get-cs::0.1.0"
import coursier.getcs.GetCs

object cs extends MillCs {
// override these to hard-code the coursier version you'd like to use
// def csVersion = MillCs.defaultVersion
// def csArmVersion = MillCs.defaultArmVersion
}
```
val csCommand = GetCs.cs() // optionally pass a coursier version to hard-code the version you're using

You can then get the command to run coursier with `cs.cs()` (typed as a `String`).
new ProcessBuilder(csCommand, "fetch", "org:name:ver")
.start()
```
126 changes: 0 additions & 126 deletions build.sc

This file was deleted.

194 changes: 0 additions & 194 deletions mill

This file was deleted.

0 comments on commit 1268264

Please sign in to comment.