Skip to content

Commit

Permalink
Setup publishing artifacts via CI
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechMazur committed May 7, 2024
1 parent a14d5db commit aae3821
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
39 changes: 31 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,52 @@
name: CI
on:
push:
tags:
- '*'
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
scalaversion: ["2.12.19", "2.13.14"]
scalaversion: ["2.12.19", "2.13.14", "3.3.3"]
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v10
- uses: actions/checkout@v3
- uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1
with:
java-version: "[email protected]"
- uses: coursier/cache-action@v5
- name: Scalastyle
run: sbt "++${{ matrix.scalaversion }}" root/scalastyle testSuiteJVM/scalastyle testSuiteJVM/test:scalastyle testSuiteNative/scalastyle testSuiteNative/test:scalastyle
jvm: adopt:8
- name: Test JVM
run: sbt "++${{ matrix.scalaversion }}" testSuiteJVM/test
- name: Test Native
run: sbt "++${{ matrix.scalaversion }}" testSuiteNative/test
- name: Test publish
run: sbt "++${{ matrix.scalaversion }}" publishLocal

publish:
name: Publish
runs-on: ubuntu-22.04
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
needs: [build]
steps:
- uses: actions/checkout@v3
- uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1
with:
jvm: adopt:8
- name: Setup PGP Key
run: |
echo -n "$PGP_SECRET" | base64 --decode | gpg --batch --import
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
- name: Publish release
env:
MAVEN_USER: "${{ secrets.SONATYPE_USER }}"
MAVEN_PASSWORD: "${{ secrets.SONATYPE_PASSWORD }}"
PGP_PASSPHRASE: "${{ secrets.PGP_PASSWORD }}"
run: sbt "clean;+root/publishSigned"
1 change: 1 addition & 0 deletions project/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.1")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "0.6.1")

addSbtPlugin("org.scalastyle" % "scalastyle-sbt-plugin" % "1.0.0")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.0")

0 comments on commit aae3821

Please sign in to comment.