Skip to content

Commit 5dac8b3

Browse files
committed
Setup publishing artifacts via CI
1 parent a351742 commit 5dac8b3

File tree

2 files changed

+32
-8
lines changed

2 files changed

+32
-8
lines changed

Diff for: .github/workflows/ci.yml

+31-8
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,52 @@
11
name: CI
22
on:
33
push:
4+
tags:
5+
- '*'
46
branches:
57
- main
68
pull_request:
79
branches:
810
- main
911
jobs:
1012
build:
11-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-22.04
1214
strategy:
1315
fail-fast: false
1416
matrix:
15-
scalaversion: ["2.12.19", "2.13.14"]
17+
scalaversion: ["2.12.19", "2.13.14", "3.3.3"]
1618
steps:
17-
- uses: actions/checkout@v2
18-
- uses: olafurpg/setup-scala@v10
19+
- uses: actions/checkout@v3
20+
- uses: coursier/cache-action@v6
21+
- uses: coursier/setup-action@v1
1922
with:
20-
java-version: "adopt@1.8"
21-
- uses: coursier/cache-action@v5
22-
- name: Scalastyle
23-
run: sbt "++${{ matrix.scalaversion }}" root/scalastyle testSuiteJVM/scalastyle testSuiteJVM/test:scalastyle testSuiteNative/scalastyle testSuiteNative/test:scalastyle
23+
jvm: adopt:8
2424
- name: Test JVM
2525
run: sbt "++${{ matrix.scalaversion }}" testSuiteJVM/test
2626
- name: Test Native
2727
run: sbt "++${{ matrix.scalaversion }}" testSuiteNative/test
2828
- name: Test publish
2929
run: sbt "++${{ matrix.scalaversion }}" publishLocal
30+
31+
publish:
32+
name: Publish
33+
runs-on: ubuntu-22.04
34+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
35+
needs: [build]
36+
steps:
37+
- uses: actions/checkout@v3
38+
- uses: coursier/cache-action@v6
39+
- uses: coursier/setup-action@v1
40+
with:
41+
jvm: adopt:8
42+
- name: Setup PGP Key
43+
run: |
44+
echo -n "$PGP_SECRET" | base64 --decode | gpg --batch --import
45+
env:
46+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
47+
- name: Publish release
48+
env:
49+
MAVEN_USER: "${{ secrets.SONATYPE_USER }}"
50+
MAVEN_PASSWORD: "${{ secrets.SONATYPE_PASSWORD }}"
51+
PGP_PASSPHRASE: "${{ secrets.PGP_PASSWORD }}"
52+
run: sbt "clean;+root/publishSigned"

Diff for: project/build.sbt

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.1")
22
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "0.6.1")
33

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

0 commit comments

Comments
 (0)