Skip to content

Commit

Permalink
Merge pull request #136 from Atry/template
Browse files Browse the repository at this point in the history
Update template
  • Loading branch information
Atry authored Jan 27, 2023
2 parents e229581 + 2526a08 commit 5790560
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 40 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/scala-steward.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
on:
workflow_dispatch:

name: Launch Scala Steward

jobs:
scala-steward:
runs-on: ubuntu-22.04
name: Launch Scala Steward
steps:
- name: Launch Scala Steward
uses: scala-steward-org/scala-steward-action@v2
with:
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }}
branches: ${{ github.ref_name }}
78 changes: 40 additions & 38 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,55 @@ name: Scala CI
on:
push:
branches-ignore:
- 'update/**'
- "update/**"
tags:
- "v*"
pull_request:

jobs:
build:

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
include:
- scala: 2.13.4
sbt-args: --addPluginSbtFile=project/plugins.sbt.scalajs06
- scala: 2.12.13
sbt-args: --addPluginSbtFile=project/plugins.sbt.scalajs06
- scala: 2.11.12
sbt-args: --addPluginSbtFile=project/plugins.sbt.scalajs06
- scala: 2.13.10
sbt-args: ''
- scala: 3.2.2
sbt-args: ''
- scala: 2.13.4
sbt-args: --addPluginSbtFile=project/plugins.sbt.scalajs06
- scala: 2.12.13
sbt-args: --addPluginSbtFile=project/plugins.sbt.scalajs06
- scala: 2.11.12
sbt-args: --addPluginSbtFile=project/plugins.sbt.scalajs06
- scala: 2.13.10
sbt-args: ''
- scala: 3.2.2
sbt-args: ''

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Need the git history for sbt-dynver to determine the version
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: temurin
- name: Cache SBT
uses: actions/cache@v3
with:
path: |
~/.ivy2/local/
~/.ivy2/cache/
~/.sbt/
~/.coursier/
key: |
${{ runner.os }}-${{matrix.scala}}-${{ hashFiles('**/*.sbt') }}
${{ runner.os }}-${{matrix.scala}}-
- name: Run tests
run: sbt ${{matrix.sbt-args}} ++${{ matrix.scala }} test
- name: Publish to Maven Central Repository
env:
GITHUB_PERSONAL_ACCESS_TOKEN: ${{secrets.PERSONAL_ACCESS_TOKEN}}
if: ${{ env.GITHUB_PERSONAL_ACCESS_TOKEN != '' && github.event_name != 'pull_request' }}
run: sbt ${{matrix.sbt-args}} ++${{ matrix.scala }} "set every Seq(sonatypeSessionName := \"${{github.workflow}} ${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}-$$ ${{ matrix.scala }}\", publishTo := sonatypePublishToBundle.value)" publishSigned sonatypeBundleRelease
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Need the git history for sbt-dynver to determine the version
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: temurin
- name: Cache SBT
uses: actions/cache@v3
with:
path: |
~/.ivy2/local/
~/.ivy2/cache/
~/.sbt/
~/.coursier/
key: |
${{runner.os}}-${{matrix.scala}}-${{hashFiles('**/*.sbt')}}-${{matrix.sbt-args}}
${{runner.os}}-${{matrix.scala}}-${{hashFiles('**/*.sbt')}}-
${{runner.os}}-${{matrix.scala}}-
- name: Run tests
run: sbt ${{matrix.sbt-args}} ++${{ matrix.scala }} test
- name: Publish to Maven Central Repository
env:
GITHUB_PERSONAL_ACCESS_TOKEN: ${{secrets.PERSONAL_ACCESS_TOKEN}}
if: ${{ env.GITHUB_PERSONAL_ACCESS_TOKEN != '' && github.event_name != 'pull_request' }}
run: sbt ${{matrix.sbt-args}} ++${{ matrix.scala }} "set every Seq(sonatypeSessionName := \"${{github.workflow}} ${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}-$$ ${{ matrix.scala }}\", publishTo := sonatypePublishToBundle.value)" publishSigned sonatypeBundleRelease
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
addSbtPlugin(
"com.thoughtworks.sbt-best-practice" % "sbt-best-practice" % "8.2.4"
"com.thoughtworks.sbt-best-practice" % "sbt-best-practice" % "8.2.5"
)

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.15")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.16")

addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")

Expand Down

0 comments on commit 5790560

Please sign in to comment.