Skip to content

Commit dfc845d

Browse files
authored
standardize sbt-ci-release setup (#351)
1 parent a600db3 commit dfc845d

File tree

2 files changed

+29
-34
lines changed

2 files changed

+29
-34
lines changed

Diff for: .github/workflows/release.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Release
2+
on:
3+
push:
4+
branches: [main]
5+
tags: ["*"]
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
- uses: actions/setup-java@v4
14+
with:
15+
distribution: temurin
16+
java-version: 8
17+
cache: sbt
18+
- run: sbt ci-release
19+
env:
20+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
21+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
22+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
23+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

Diff for: .github/workflows/validate.yml

+6-34
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
name: Test and publish
1+
name: Test
22

33
on:
44
pull_request:
55
push:
6-
branches: [ main ]
7-
tags: [ v* ]
6+
branches:
7+
- main
88

99
jobs:
10-
compile-and-test:
11-
name: Compile and test and publish
10+
test:
11+
name: test
1212
runs-on: ubuntu-latest
1313
strategy:
1414
fail-fast: false
@@ -36,33 +36,5 @@ jobs:
3636
- name: Cache Coursier cache
3737
uses: coursier/cache-action@v6
3838

39-
- name: Compile and test on JDK ${{matrix.java}}, Scala ${{matrix.scala}}
39+
- name: Test on JDK ${{matrix.java}}, Scala ${{matrix.scala}}
4040
run: sbt ++${{matrix.scala}} test
41-
42-
publish:
43-
name: Publish to Maven Central
44-
if: startsWith(github.ref, 'refs/tags/v')
45-
needs: [ compile-and-test ]
46-
runs-on: ubuntu-latest
47-
48-
steps:
49-
- name: Checkout
50-
uses: actions/checkout@v4
51-
with:
52-
fetch-depth: 0
53-
54-
- name: Set up JDK 8
55-
uses: actions/setup-java@v4
56-
with:
57-
distribution: temurin
58-
java-version: 8
59-
60-
- name: Cache Coursier cache
61-
uses: coursier/cache-action@v6
62-
63-
- name: Publish
64-
run: sbt ci-release
65-
env:
66-
PGP_SECRET: ${{ secrets.PGP_SECRET }}
67-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
68-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

0 commit comments

Comments
 (0)