Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

standardize sbt-ci-release setup #351

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}