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

Switch publishing to CI #72

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- directory: /
open-pull-requests-limit: 10
package-ecosystem: github-actions
rebase-strategy: auto
schedule:
interval: daily
97 changes: 83 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,92 @@
name: Test
name: 'Test & Publish'

on:
workflow_dispatch:
push:
branches: [ '*' ]
branches: [ master ]
tags: [ v* ]
pull_request:
branches: [ master ]

jobs:
build:

test:
name: Execute Tests (Java ${{ matrix.java }})

strategy:
fail-fast: false
matrix:
java: [ 8, 11, 17 ]
runs-on: ubuntu-latest

steps:
- name: Checkout Source Code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{ matrix.java }}
cache: sbt

- name: Execute sbt Scripted Tests
run: sbt scripted

analysis:
name: Analyse Code
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Java 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
cache: sbt

- name: Analyse Source Code Formatting
run: sbt scalafmtCheckAll

publish:
name: Publish Release
runs-on: ubuntu-latest
needs: [ test, analysis ]
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v')

steps:
- uses: actions/checkout@v2
- uses: coursier/cache-action@v5
- name: Set up JDK 11
uses: olafurpg/setup-scala@v10
with:
java-version: [email protected]
- name: Scalafmt Check
run: sbt scalafmtCheckAll
- name: "aetherDeploy Scripted"
run: sbt aetherDeploy/scripted
# Handle gpg signed stuff

- name: Checkout Source Code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Java 8
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
cache: sbt

- name: Import Signing Key
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_SIGNING_KEY }}
passphrase: ${{ secrets.GPG_SIGNING_KEY_PASSPHRASE }}

- name: Update Signing Key Trust Level
run: echo -e "trust\n5\ny" | gpg --batch --no-tty --command-fd 0 --edit-key ${{ secrets.GPG_SIGNING_KEY_ID }}

- name: Publish Release
run: sbt aetherDeploy
with:
PUBLISH_USER: ${{ secrets.PUBLISH_USER }}
PUBLISH_USER_PASSPHRASE: ${{ secrets.PUBLISH_USER_PASSPHRASE }}
SIGNING_KEY_ID: ${{ secrets.GPG_SIGNING_KEY_ID }}
SIGNING_KEY_PASSPHRASE: ${{ secrets.GPG_SIGNING_KEY_PASSPHRASE }}
12 changes: 9 additions & 3 deletions gpg.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import scala.sys.Prop

pgpSecretRing := Prop.FileProp("user.home").value / ".gnupg/pubring.gpg"
inThisBuild(
List(
PgpKeys.pgpSelectPassphrase :=
sys.props
.get("SIGNING_KEY_PASSPHRASE")
.map(_.toCharArray),
usePgpKeyHex(System.getenv("SIGNING_KEY_ID"))
)
)
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.5.2
sbt.version=1.8.0
9 changes: 8 additions & 1 deletion publish.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ ThisBuild / packageOptions += {
)
}

ThisBuild / credentials += Credentials(Path.userHome / ".sbt" / "arktekk-credentials")
ThisBuild / credentials := List (
Credentials(
"",
"oss.sonatype.org",
System.getenv("PUBLISH_USER"),
System.getenv("PUBLISH_USER_PASSPHRASE")
)
)

ThisBuild / pomIncludeRepository := { x =>
false
Expand Down