Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use sbt-ci-release and setup-java GHA #577

Merged
merged 1 commit into from
Sep 16, 2022
Merged
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
38 changes: 17 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
java: [adopt@1.8]
java: [8]
scalaVersion: ["2_12", "2_13", "3"]
scalaPlatform: ["jvm", "js", "native"]
runs-on: ${{ matrix.os }}
Expand All @@ -33,10 +33,11 @@ jobs:
with:
extraKey: ${{ env.BUILD_KEY }}

- name: Setup Java and Scala
uses: olafurpg/setup-scala@v10
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'sbt'

- name: Run tests
run: |
Expand Down Expand Up @@ -71,37 +72,33 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout current branch
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Cache
uses: coursier/cache-action@v6

- name: Setup Java and Scala
uses: olafurpg/setup-scala@v10
- uses: actions/setup-java@v3
with:
java-version: adopt@1.8
distribution: 'temurin'
java-version: '8'
cache: 'sbt'

- name: Run mdoc
run: sbt "docs/mdoc"

publish:
name: Publish
needs: [documentation, build]
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || (github.ref == 'refs/heads/main'))
runs-on: ubuntu-latest
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Java and Scala
uses: olafurpg/setup-scala@v10
- uses: actions/setup-java@v3
with:
java-version: adopt@1.8

- name: Cache
uses: coursier/cache-action@v6
distribution: 'temurin'
java-version: '8'
cache: 'sbt'

- name: Download compilation cache
uses: actions/download-artifact@v2
Expand All @@ -113,8 +110,7 @@ jobs:

- name: Publish ${{ github.ref }}
run: |
echo $PGP_SECRET | base64 --decode | gpg --import --no-tty --batch --yes
sbt 'pullRemoteCache; release'
sbt 'pullRemoteCache; ci-release'
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
Expand All @@ -128,7 +124,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
Expand Down
16 changes: 1 addition & 15 deletions project/WeaverPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -375,21 +375,7 @@ object WeaverPlugin extends AutoPlugin {
email = "anton.sviridov@disneystreaming.com",
url = url("https://github.com/keynmol")
)
),
credentials ++=
sys.env
.get("SONATYPE_USER")
.zip(sys.env.get("SONATYPE_PASSWORD"))
.map {
case (username, password) =>
Credentials(
"Sonatype Nexus Repository Manager",
"oss.sonatype.org",
username,
password
)
}
.toSeq
)
)

def createBuildCommands(projects: Seq[ProjectReference]) = {
Expand Down
4 changes: 1 addition & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.1"
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.1")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.7")
addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.9.0")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.1.1")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.13")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.3")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")