Skip to content

Commit

Permalink
Merge pull request #221 from com-lihaoyi/scala-2.11
Browse files Browse the repository at this point in the history
Publish for Scala 2.11
  • Loading branch information
lolgab committed Mar 25, 2021
2 parents c421058 + 9bf2685 commit 1eaa29b
Show file tree
Hide file tree
Showing 6 changed files with 1,201 additions and 142 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: ci

on:
push:
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Install node and jsdom
run: |
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
npm install
- name: Run tests
run: ./mill -i __.publishArtifacts __.test

publish-sonatype:
if: github.repository == 'com-lihaoyi/scalatags' && contains(github.ref, 'refs/tags/')
needs: test
runs-on: ubuntu-latest
env:
SONATYPE_PGP_PRIVATE_KEY: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY }}
SONATYPE_PGP_PRIVATE_KEY_PASSWORD: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY_PASSWORD }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
LANG: "en_US.UTF-8"
LC_MESSAGES: "en_US.UTF-8"
LC_ALL: "en_US.UTF-8"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Publish to Maven Central
run: |
if [[ $(git tag --points-at HEAD) != '' ]]; then
echo $SONATYPE_PGP_PRIVATE_KEY | base64 --decode > gpg_key
gpg --import --no-tty --batch --yes gpg_key
rm gpg_key
./mill -i mill.scalalib.PublishModule/publishAll \
--sonatypeCreds $SONATYPE_USER:$SONATYPE_PASSWORD \
--gpgArgs --passphrase=$SONATYPE_PGP_PRIVATE_KEY_PASSWORD,--no-tty,--pinentry-mode,loopback,--batch,--yes,-a,-b \
--publishArtifacts __.publishArtifacts \
--readTimeout 600000 \
--awaitTimeout 600000 \
--release true \
--signed true
fi
2 changes: 1 addition & 1 deletion .mill-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.4-29-9d1d6f
0.9.5-52-ef6d5d
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

11 changes: 7 additions & 4 deletions build.sc
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import mill._, scalalib._, scalajslib._, scalanativelib._, publish._
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version_mill0.9:0.1.1`
import de.tobiasroeser.mill.vcs.version.VcsVersion

val dottyVersions = sys.props.get("dottyVersion").toList

val scalaVersions = "2.12.13" :: "2.13.4" :: dottyVersions
val scalaVersions = "2.12.13" :: "2.13.4" :: "2.11.12" :: dottyVersions
val scala2Versions = scalaVersions.filter(_.startsWith("2."))

val scalaJSVersions = for {
Expand All @@ -18,7 +20,7 @@ val scalaNativeVersions = for {
trait ScalatagsPublishModule extends PublishModule {
def artifactName = "scalatags"

def publishVersion = "0.9.3"
def publishVersion = VcsVersion.vcsState().format()

def pomSettings = PomSettings(
description = artifactName(),
Expand All @@ -39,7 +41,7 @@ trait Common extends CrossScalaModule {
def millSourcePath = super.millSourcePath / offset
def ivyDeps = Agg(
ivy"com.lihaoyi::sourcecode::0.2.3",
ivy"com.lihaoyi::geny::0.6.5",
ivy"com.lihaoyi::geny::0.6.7",
)
def compileIvyDeps = Agg(
ivy"org.scala-lang:scala-reflect:${scalaVersion()}",
Expand All @@ -59,9 +61,10 @@ trait Common extends CrossScalaModule {
trait CommonTestModule extends ScalaModule with TestModule {
def millSourcePath = super.millSourcePath / os.up
def crossScalaVersion: String
val scalaXmlVersion = if(crossScalaVersion.startsWith("2.11.")) "1.3.0" else "2.0.0-M3"
def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.7",
ivy"org.scala-lang.modules::scala-xml:2.0.0-M3"
ivy"org.scala-lang.modules::scala-xml:$scalaXmlVersion"
)
def offset: os.RelPath = os.rel
def testFrameworks = Seq("utest.runner.Framework")
Expand Down
2 changes: 1 addition & 1 deletion mill
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This is a wrapper script, that automatically download mill from GitHub release pages
# You can give the required mill version with MILL_VERSION env variable
# If no version is given, it falls back to the value of DEFAULT_MILL_VERSION
DEFAULT_MILL_VERSION=0.9.4-29-9d1d6f
DEFAULT_MILL_VERSION=0.9.5-52-ef6d5d

set -e

Expand Down
Loading

0 comments on commit 1eaa29b

Please sign in to comment.