Skip to content

Commit

Permalink
Automating Release Pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
ChetanBhasin committed May 19, 2020
1 parent 08ac04b commit aa7f305
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 41 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Cross Release After Testing

on:
create:
branches:
- 'refs/tags/*'

jobs:
test-and-release:

runs-on: ubuntu-latest

env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE}}
GPG_KEYS: ${{ secrets.GPG_KEYS}}
SONATYPE_SBT: ${{ secrets.SONATYPE_SBT }}

steps:
- uses: actions/checkout@v2
- name: Setup JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Setup GPG Keys
run: |
echo $GPG_KEYS | base64 -di > keys.zip
unzip -d project/.gnupg keys.zip
mkdir -p ~/.sbt/1.0
echo $SONATYPE_SBT > ~/.sbt/1.0/sonatype.sbt
- name: Setup version in SBT
run: |
VERSION=${GITHUB_REF/refs\/tags\//}
echo $VERSION
sed "s/unstable-SNAPSHOT/${VERSION}/" build.sbt > build.sbt.2
mv build.sbt.2 build.sbt
- name: Test & Release
run: |
VERSION=${GITHUB_REF/refs\/tags\//}
if [[ $VERSION =~ \-SNAPSHOT$ ]]; then
sbt test +publishSigned
else
sbt test +publishSigned sonatypeRelease
fi
37 changes: 0 additions & 37 deletions .gitlab-ci.yml

This file was deleted.

12 changes: 8 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ScalaOptions._

organization in ThisBuild := "com.enfore"
ThisBuild / crossScalaVersions := supportedVersions
version in ThisBuild := "1.3.5"
version in ThisBuild := "unstable-SNAPSHOT"
fork in Test in ThisBuild := true

lazy val http4s = Seq(http4sCore, http4sDsl, http4sCirce, http4sServer)
Expand Down Expand Up @@ -86,9 +86,13 @@ lazy val `sbt-openapi` = (project in file("sbt-openapi"))
lazy val publishSettings = Seq(
crossPaths := true,
autoAPIMappings := true,
publishTo := Some(
Opts.resolver.sonatypeSnapshots
),
publishTo := {
if (isSnapshot.value)
Some(
Opts.resolver.sonatypeSnapshots
)
else Some(Opts.resolver.sonatypeStaging)
},
useGpg := false,
usePgpKeyHex("1EAA6358E4812E9E"),
pgpPublicRing := file(".") / "project" / ".gnupg" / "pubring.gpg",
Expand Down

0 comments on commit aa7f305

Please sign in to comment.