Skip to content

Commit

Permalink
standardize sbt-ci-release setup (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
SethTisue authored Mar 11, 2024
1 parent a600db3 commit dfc845d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 34 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release
on:
push:
branches: [main]
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
cache: sbt
- run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
40 changes: 6 additions & 34 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Test and publish
name: Test

on:
pull_request:
push:
branches: [ main ]
tags: [ v* ]
branches:
- main

jobs:
compile-and-test:
name: Compile and test and publish
test:
name: test
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -36,33 +36,5 @@ jobs:
- name: Cache Coursier cache
uses: coursier/cache-action@v6

- name: Compile and test on JDK ${{matrix.java}}, Scala ${{matrix.scala}}
- name: Test on JDK ${{matrix.java}}, Scala ${{matrix.scala}}
run: sbt ++${{matrix.scala}} test

publish:
name: Publish to Maven Central
if: startsWith(github.ref, 'refs/tags/v')
needs: [ compile-and-test ]
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JDK 8
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8

- name: Cache Coursier cache
uses: coursier/cache-action@v6

- name: Publish
run: sbt ci-release
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

0 comments on commit dfc845d

Please sign in to comment.