Skip to content

Commit b1c9046

Browse files
authored
Merge pull request #173 from ThoughtWorksInc/update/template
Update template
2 parents d5ab812 + f9c67f8 commit b1c9046

File tree

11 files changed

+105
-51
lines changed

11 files changed

+105
-51
lines changed

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Scala Steward: Reformat with scalafmt 3.1.2
2+
fb6cfb8aea15a1b339e3ed69e1e96acd7df4cae6
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
on:
2+
push:
3+
branches-ignore:
4+
- "update/**"
5+
schedule:
6+
- cron: "0 0 * * 0"
7+
workflow_dispatch:
8+
9+
name: Update Scala project template
10+
11+
jobs:
12+
update-scala-project-template:
13+
permissions:
14+
# for aws-actions/configure-aws-credentials to assume an AWS role
15+
id-token: write
16+
# for peter-evans/create-pull-request to create branch
17+
contents: write
18+
# for peter-evans/create-pull-request to create a PR
19+
pull-requests: write
20+
runs-on: ubuntu-22.04
21+
steps:
22+
- uses: actions/checkout@v3
23+
- run: git fetch https://github.com/Atry/scala-project-template.git template
24+
- run: git reset --hard FETCH_HEAD
25+
- uses: peter-evans/create-pull-request@v5
26+
with:
27+
delete-branch: true
28+
base: ${{github.ref_name}}
29+
branch: update/${{github.ref_name}}/scala-project-template
30+
title: Update scala-project-template
31+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
on:
2+
push:
3+
branches-ignore:
4+
- "update/**"
5+
schedule:
6+
- cron: "0 0 * * 0"
7+
workflow_dispatch:
8+
9+
name: Launch Scala Steward
10+
11+
jobs:
12+
scala-steward:
13+
runs-on: ubuntu-22.04
14+
name: Launch Scala Steward
15+
steps:
16+
- name: Launch Scala Steward
17+
uses: scala-steward-org/scala-steward-action@v2
18+
with:
19+
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }}
20+
branches: ${{ github.ref_name }}

.github/workflows/scala.yml

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,48 @@
11
name: Scala CI
22

33
on:
4-
- push
5-
- pull_request
4+
push:
5+
branches-ignore:
6+
- "update/**"
7+
tags:
8+
- "v*"
9+
pull_request:
610

711
jobs:
812
build:
9-
1013
runs-on: ubuntu-latest
1114

1215
strategy:
16+
fail-fast: false
1317
matrix:
1418
scala:
15-
- 2.12.15
19+
- 2.12.15
1620

1721
steps:
18-
- uses: actions/checkout@v2
19-
with:
20-
fetch-depth: 0 # Need the git history for sbt-dynver to determine the version
21-
- name: Set up JDK 11
22-
uses: actions/setup-java@v2
23-
with:
24-
java-version: '11'
25-
distribution: 'adopt'
26-
- name: Cache SBT
27-
uses: actions/cache@v2
28-
with:
29-
path: |
30-
~/.ivy2/cache/
31-
~/.sbt/
32-
~/.coursier/
33-
key: |
34-
${{ runner.os }}-${{matrix.scala}}-${{ hashFiles('**/*.sbt') }}
35-
${{ runner.os }}-${{matrix.scala}}-
36-
- name: Run tests
37-
run: sbt ++${{ matrix.scala }} test
38-
- name: Publish to Maven Central Repository
39-
env:
40-
GITHUB_PERSONAL_ACCESS_TOKEN: ${{secrets.PERSONAL_ACCESS_TOKEN}}
41-
if: ${{ env.GITHUB_PERSONAL_ACCESS_TOKEN != '' }}
42-
run: sbt ++${{ matrix.scala }} "set every Seq(sonatypeSessionName := \"${{github.workflow}} ${{github.run_id}} ${{github.run_number}} ${{github.run_attempt}} ${{ matrix.scala }}\", publishTo := sonatypePublishToBundle.value)" publishSigned sonatypeBundleRelease
22+
- uses: actions/checkout@v3
23+
with:
24+
fetch-depth: 0 # Need the git history for sbt-dynver to determine the version
25+
- name: Set up JDK 11
26+
uses: actions/setup-java@v3
27+
with:
28+
java-version: "11"
29+
distribution: temurin
30+
- name: Cache SBT
31+
uses: actions/cache@v3
32+
with:
33+
path: |
34+
~/.ivy2/local/
35+
~/.ivy2/cache/
36+
~/.sbt/
37+
~/.coursier/
38+
key: |
39+
${{runner.os}}-${{matrix.scala}}-${{hashFiles('**/*.sbt')}}-${{matrix.sbt-args}}
40+
${{runner.os}}-${{matrix.scala}}-${{hashFiles('**/*.sbt')}}-
41+
${{runner.os}}-${{matrix.scala}}-
42+
- name: Run tests
43+
run: sbt ${{matrix.sbt-args}} ++${{ matrix.scala }} test
44+
- name: Publish to Maven Central Repository
45+
env:
46+
GITHUB_PERSONAL_ACCESS_TOKEN: ${{secrets.PERSONAL_ACCESS_TOKEN}}
47+
if: ${{ env.GITHUB_PERSONAL_ACCESS_TOKEN != '' && github.event_name != 'pull_request' }}
48+
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

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ secret/
2626
.metals/
2727
.bloop/
2828
metals.sbt
29-
.bsp/sbt.json
29+
.bsp/
30+
.vscode/launch.json
31+
*.scala.semanticdb

.gitpod.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.scalafmt.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
version = "3.7.3"
2-
maxColumn = 120
1+
runner.dialect = scala212source3
2+
version = "3.7.5"
3+
maxColumn = 80

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.8.2
1+
sbt.version=1.9.1

project/plugins.sbt

Lines changed: 0 additions & 11 deletions
This file was deleted.

project/sbt-best-practice.sbt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
addSbtPlugin(
2+
"com.thoughtworks.sbt-best-practice" % "sbt-best-practice" % "8.3.0"
3+
)

0 commit comments

Comments
 (0)