Skip to content

Commit

Permalink
Merge pull request #127 from Atry/update-template
Browse files Browse the repository at this point in the history
Update template
  • Loading branch information
Atry authored Feb 3, 2023
2 parents fdcab33 + 341c9df commit d47156b
Show file tree
Hide file tree
Showing 11 changed files with 107 additions and 50 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Scala Steward: Reformat with scalafmt 3.1.2
fb6cfb8aea15a1b339e3ed69e1e96acd7df4cae6
20 changes: 20 additions & 0 deletions .github/workflows/scala-steward.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
on:
push:
branches-ignore:
- "update/**"
schedule:
- cron: "0 0 * * 0"
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 }}
50 changes: 50 additions & 0 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Scala CI

on:
push:
branches-ignore:
- "update/**"
tags:
- "v*"
pull_request:

jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
scala:
- 2.10.7
- 2.11.12
- 2.12.11

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')}}-${{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
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
target/
local.sbt
secret/
*.class
.metals/
.bloop/
metals.sbt
.bsp/
.vscode/launch.json
*.scala.semanticdb
5 changes: 5 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
image: igeolise/scalajs-test-runner:latest
vscode:
extensions:
- scala-lang.scala@0.3.8:wQBBM+lKILHBqOqlqW60xA==
- scalameta.metals@1.9.0:EyAIfy0ykjUn9htpw3f7GA==
5 changes: 3 additions & 2 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
version = "1.5.1"
maxColumn = 120
runner.dialect = scala212source3
version = "3.7.1"
maxColumn = 80
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.watcherExclude": {
"**/target": true
}
}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.3.4
sbt.version=1.8.2
14 changes: 8 additions & 6 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
addSbtPlugin("com.thoughtworks.sbt-best-practice" % "sbt-best-practice" % "7.1.1")
addSbtPlugin(
"com.thoughtworks.sbt-best-practice" % "sbt-best-practice" % "8.2.5"
)

addSbtPlugin("com.thoughtworks.sbt-scala-js-map" % "sbt-scala-js-map" % "4.0.0")

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.31")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.32")

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.8.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.17")

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

addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")

addSbtPlugin("org.lyranthe.sbt" % "partial-unification" % "1.1.2")

addSbtPlugin("com.thoughtworks.example" % "sbt-example" % "7.0.0")
addSbtPlugin("com.thoughtworks.example" % "sbt-example" % "9.2.1")
9 changes: 7 additions & 2 deletions secret.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ lazy val secret = {
IO.delete(secretDirectory)
org.eclipse.jgit.api.Git
.cloneRepository()
.setURI("https://github.com/ThoughtWorksInc/tw-data-china-continuous-delivery-password.git")
.setURI(
"https://github.com/ThoughtWorksInc/tw-data-china-continuous-delivery-password.git"
)
.setDirectory(secretDirectory)
.setCredentialsProvider(
new org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider(token, "")
new org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider(
token,
""
)
)
.call()
.close()
Expand Down

0 comments on commit d47156b

Please sign in to comment.