Skip to content

Commit f74c5c2

Browse files
committed
Publish to Sonatype with GitHub Actions
1 parent def7d43 commit f74c5c2

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

.github/workflows/sonatype.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Sonatype Publish
2+
3+
on:
4+
workflow_run:
5+
workflows: [CI]
6+
types: [completed]
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
if: ${{ github.event.workflow_run.conclusion == 'success' && (github.event.workflow_run.head_branch == 'main' || startsWith(github.event.workflow_run.head_branch, 'v')) }}
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- name: Coursier cache
17+
uses: coursier/cache-action@v6
18+
- uses: coursier/setup-action@v1
19+
with:
20+
jvm: zulu:11.0.10
21+
apps: sbt scala
22+
- uses: taiki-e/install-action@parse-changelog
23+
- name: Set build timestamp
24+
run: echo "SOURCE_DATE_EPOCH=$(date -d $(parse-changelog CHANGELOG.md -t | rev | cut -d' ' -f1 | rev) '+%s')" >> "$GITHUB_ENV"
25+
- run: sbt ci-release
26+
env:
27+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
28+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
29+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
30+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

build.sbt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,5 @@ apiMappings ++= {
219219

220220
ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org"
221221
sonatypeRepository := "https://s01.oss.sonatype.org/service/local"
222-
publishMavenStyle := true
223-
publishTo := sonatypePublishTo.value
224222
ThisBuild / dynverSonatypeSnapshots := true
225223
ThisBuild / dynverSeparator := "-"

0 commit comments

Comments
 (0)