Skip to content

Commit

Permalink
#205: Release process is broken
Browse files Browse the repository at this point in the history
* removed incompatible settings from sbt project setup
* separated Sonatype and GitHub release, as they use different Java versions
* updated build.yml for newest action versions
  • Loading branch information
benedeki committed Jun 4, 2024
1 parent ca39b78 commit 79b0a90
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 8 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: coursier/cache-action@v5

- name: Setup Scala
Expand Down Expand Up @@ -60,7 +62,9 @@ jobs:
- 5432:5432
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: coursier/cache-action@v5

- name: Setup Scala
Expand Down
34 changes: 30 additions & 4 deletions .github/workflows/release_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,47 @@ on:
types: [released]

jobs:
publish:
publish-to-sonatype:
name: Publish to Sonatype
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: olafurpg/setup-scala@v14
- name: Run sbt ci-release (produces jar as well)
- uses: coursier/cache-action@v5

- name: Setup Scala
uses: olafurpg/setup-scala@v14
with:
java-version: "[email protected]"

- name: Run sbt ci-release
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 }}


publish-server-jar:
name: Publish server jar
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: coursier/cache-action@v5

- name: Setup Scala
uses: olafurpg/setup-scala@v14
with:
java-version: "[email protected]"
- name: Run sbt ci-release (produces jar as well)
run: sbt assembly

- name: Find JAR file
id: find_jar
run: echo "JAR_PATH=$(find . -name 'server/target/jvm-2.13/*.jar' | head -n 1)" >> $GITHUB_ENV
Expand Down
4 changes: 2 additions & 2 deletions project/Setup.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ object Setup {
val commonScalacOptions: Seq[String] = Seq("-unchecked", "-deprecation", "-feature", "-Xfatal-warnings")

val serverAndDbJavacOptions: Seq[String] = Seq("-source", "11", "-target", "11", "-Xlint")
val serverAndDbScalacOptions: Seq[String] = Seq("-release", "11", "-Ymacro-annotations")
val serverAndDbScalacOptions: Seq[String] = Seq("-Ymacro-annotations")

val clientJavacOptions: Seq[String] = Seq("-source", "1.8", "-target", "1.8", "-Xlint")
def clientScalacOptions(scalaVersion: Version): Seq[String] = {
if (scalaVersion >= scala213) {
Seq("-release", "8", "-Ymacro-annotations")
} else {
Seq("-target", "8", "-release", "8")
Seq("-release", "8", "-target:8")
}
}

Expand Down

0 comments on commit 79b0a90

Please sign in to comment.