diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000..a94ba1f --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# Scala Steward: Reformat with scalafmt 3.1.2 +fb6cfb8aea15a1b339e3ed69e1e96acd7df4cae6 diff --git a/.github/workflows/scala-project-template.yml b/.github/workflows/scala-project-template.yml new file mode 100644 index 0000000..982e639 --- /dev/null +++ b/.github/workflows/scala-project-template.yml @@ -0,0 +1,31 @@ +on: + push: + branches-ignore: + - "update/**" + schedule: + - cron: "0 0 * * 0" + workflow_dispatch: + +name: Update Scala project template + +jobs: + update-scala-project-template: + permissions: + # for aws-actions/configure-aws-credentials to assume an AWS role + id-token: write + # for peter-evans/create-pull-request to create branch + contents: write + # for peter-evans/create-pull-request to create a PR + pull-requests: write + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - run: git fetch https://github.com/Atry/scala-project-template.git template + - run: git reset --hard FETCH_HEAD + - uses: peter-evans/create-pull-request@v5 + with: + delete-branch: true + base: ${{github.ref_name}} + branch: update/${{github.ref_name}}/scala-project-template + title: Update scala-project-template + token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} diff --git a/.github/workflows/scala-steward.yml b/.github/workflows/scala-steward.yml new file mode 100644 index 0000000..5350439 --- /dev/null +++ b/.github/workflows/scala-steward.yml @@ -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 }} diff --git a/.github/workflows/scala.yml b/.github/workflows/scala.yml new file mode 100644 index 0000000..4f71e11 --- /dev/null +++ b/.github/workflows/scala.yml @@ -0,0 +1,48 @@ +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.12.15 + + 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 diff --git a/.gitignore b/.gitignore index d180f4b..5701ab5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ target/ local.sbt secret/ +.metals/ +.bloop/ +metals.sbt +.bsp/ +.vscode/launch.json +*.scala.semanticdb diff --git a/.scalafmt.conf b/.scalafmt.conf index f216dbf..e26dcdb 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,2 +1,3 @@ -version = "1.5.1" -maxColumn = 120 \ No newline at end of file +runner.dialect = scala212source3 +version = "3.7.5" +maxColumn = 80 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7ed3a0a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ -sudo: false - -addons: - apt: - packages: - - graphviz - -language: scala - -scala: - - 2.12.8 - -jdk: - - openjdk8 - -before_cache: - - find $HOME/.sbt -name '*.lock' -delete - - find $HOME/.ivy2 -name 'ivydata-*.properties' -delete - -cache: - directories: - - $HOME/.ivy2/cache - - $HOME/.sbt/boot/ - - $HOME/.coursier/ - -before_script: - -before_deploy: - -deploy: - - provider: script - script: sbt ++$TRAVIS_SCALA_VERSION "set every Seq(sonatypeSessionName := \"Travis Job $TRAVIS_JOB_NAME $TRAVIS_JOB_NUMBER ($TRAVIS_JOB_WEB_URL)\", publishTo := sonatypePublishToBundle.value)" publishSigned sonatypeBundleRelease - skip_cleanup: true - on: - all_branches: true - condition: $GITHUB_PERSONAL_ACCESS_TOKEN diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..32cfc61 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.watcherExclude": { + "**/target": true + } +} \ No newline at end of file diff --git a/project/build.properties b/project/build.properties index 8522443..3c0b78a 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.3.2 +sbt.version=1.9.1 diff --git a/project/plugins.sbt b/project/plugins.sbt deleted file mode 100644 index 4842aae..0000000 --- a/project/plugins.sbt +++ /dev/null @@ -1,11 +0,0 @@ -addSbtPlugin("com.thoughtworks.sbt-best-practice" % "sbt-best-practice" % "7.1.1") - -addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.8") - -addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0") - -addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2") - -addSbtPlugin("org.lyranthe.sbt" % "partial-unification" % "1.1.2") - -addSbtPlugin("com.thoughtworks.example" % "sbt-example" % "6.0.1") diff --git a/project/sbt-best-practice.sbt b/project/sbt-best-practice.sbt new file mode 100644 index 0000000..1340249 --- /dev/null +++ b/project/sbt-best-practice.sbt @@ -0,0 +1,3 @@ +addSbtPlugin( + "com.thoughtworks.sbt-best-practice" % "sbt-best-practice" % "8.3.0" +) diff --git a/secret.sbt b/secret.sbt index bb264c7..31f167b 100644 --- a/secret.sbt +++ b/secret.sbt @@ -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/Atry/secrets.git" + ) .setDirectory(secretDirectory) .setCredentialsProvider( - new org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider(token, "") + new org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider( + token, + "" + ) ) .call() .close()