Skip to content

Commit

Permalink
Publish artifacts in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
limansky committed Oct 10, 2024
1 parent 8a8917a commit 96783b9
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up JDK 8
uses: actions/setup-java@v4.2.2
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
Expand All @@ -36,3 +36,35 @@ jobs:
- name: Run tests sbt 2.x
if: ${{ matrix.sbt == 2 }}
run: sbt ++3.3.4 test scripted

publish:
name: Publish artifacts
needs: [build]
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v'))

runs-on: ubuntu-latest
steps:
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: sbt

- name: Set up SBT
uses: sbt/setup-sbt@v1

- name: Publish snapshot
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: sbt --client +publish
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}

- name: Publish release
if: startsWith(github.ref, 'refs/tags/v')
run: sbt --client +publishSigned sonatypeBundleRelease
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}

0 comments on commit 96783b9

Please sign in to comment.