Skip to content

Commit

Permalink
Remove sbt-github-actions plugin, since we have a bit more complicate…
Browse files Browse the repository at this point in the history
…d build
  • Loading branch information
pomadchin committed Oct 24, 2021
1 parent d1db008 commit 1190634
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 104 deletions.
58 changes: 16 additions & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ on:
pull_request:
branches: ['**']
push:
branches: ['**']
branches: ['master']
tags: ['v*']
release:
types: ['published']

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -26,31 +29,14 @@ jobs:
java: [adopt@1.8]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Java and Scala
uses: olafurpg/setup-scala@v13
- uses: coursier/cache-action@v6
- uses: olafurpg/setup-scala@v13
with:
java-version: ${{ matrix.java }}

- name: Cache sbt
uses: actions/cache@v2
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
~/AppData/Local/Coursier/Cache/v1
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Check that workflows are up to date
run: sbt ++${{ matrix.scala }} githubWorkflowCheck

- name: Setup Python
uses: actions/setup-python@v2
with:
Expand All @@ -75,40 +61,28 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.15]
scala: [2.12.15, 2.13.6]
java: [adopt@1.8]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Java and Scala
uses: olafurpg/setup-scala@v13
- uses: coursier/cache-action@v6
- uses: olafurpg/setup-scala@v13
with:
java-version: ${{ matrix.java }}

- name: Cache sbt
uses: actions/cache@v2
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
~/AppData/Local/Coursier/Cache/v1
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Publish artifacts
if: ${{ env.SONATYPE_PASSWORD != '' && env.SONATYPE_USERNAME != '' }}
- name: Release
run: sbt ++${{ matrix.scala }} ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
run: sbt ++${{ matrix.scala }} ci-release
CI_SNAPSHOT_RELEASE: "frameless-publish"
CI_RELEASE: "frameless-publishSigned"
if: ${{ env.SONATYPE_PASSWORD != '' && env.SONATYPE_USERNAME != '' }}

docs:
name: Documentation
Expand Down
60 changes: 0 additions & 60 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -365,63 +365,3 @@ lazy val copyReadmeImpl = Def.task {
sbt.IO.copy(List((from, to)), overwrite = true, preserveLastModified = true, preserveExecutable = true)
}
copyReadme := copyReadmeImpl.value

ThisBuild / githubWorkflowArtifactUpload := false

ThisBuild / githubWorkflowBuild := Seq(
WorkflowStep.Use(
UseRef.Public("actions", "setup-python", "v2"),
name = Some("Setup Python"),
params = Map("python-version" -> "3.x")
),
WorkflowStep.Run(
List("pip install codecov"),
name = Some("Setup codecov")
),
WorkflowStep.Sbt(
List("coverage", "frameless-test"),
name = Some("Test & Compute Coverage")
),
WorkflowStep.Run(
List("codecov -F ${{ matrix.scala }}"),
name = Some("Upload Codecov Results")
)
)

ThisBuild / githubWorkflowBuild += WorkflowStep.Sbt(
List("frameless-mimaReportBinaryIssues"),
name = Some("Binary compatibility check")
)

ThisBuild / githubWorkflowPublishTargetBranches := Seq(
RefPredicate.Equals(Ref.Branch("master")),
RefPredicate.StartsWith(Ref.Tag("v"))
)

ThisBuild / githubWorkflowPublish := Seq(
WorkflowStep.Sbt(
List("ci-release"),
name = Some("Publish artifacts"),
env = Map(
"PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}",
"PGP_SECRET" -> "${{ secrets.PGP_SECRET }}",
"SONATYPE_PASSWORD" -> "${{ secrets.SONATYPE_PASSWORD }}",
"SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}"
),
cond = Some("${{ env.SONATYPE_PASSWORD != '' && env.SONATYPE_USERNAME != '' }}")
)
)

ThisBuild / githubWorkflowAddedJobs ++= Seq(
WorkflowJob(
"docs",
"Documentation",
githubWorkflowJobSetup.value.toList ::: List(
WorkflowStep.Sbt(
List("doc", "mdoc"),
name = Some("Documentation")
)
),
scalas = List(Scala212)
)
)
3 changes: 1 addition & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.1")
addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.13.0")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.24")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.0.1")

0 comments on commit 1190634

Please sign in to comment.