Skip to content
Merged
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
23 changes: 23 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Description
Mandatory, provide a detailed description of the changes.

## Why
Optional i.e. "Why I have chosen package X, and not alternative package Y, Z"

## AC
Copy and paste from task

## Source
Link to jira story/task/bug

## Type
- [ ] Bug Fix
- [ ] Feature Addition
- [ ] Refactor
- [ ] HotFix

## Checklist
- [ ] tested locally
- [ ] added new dependencies
- [ ] updated the docs
- [ ] added a test
34 changes: 34 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'

categories:
- title: 'Features'
labels:
- 'feature'
- title: 'Bugs'
labels:
- 'bug'
- 'fix'
- title: 'Maintenance'
labels:
- 'chore'

change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&'

version-resolver:
default: patch
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'

template: |
## Changes

$CHANGES
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
workflow_dispatch:
push:
branches-ignore:
- main

jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup
uses: actions/setup-java@v1
with:
java-version: 11
java-package: jdk
architecture: x64

- name: Clean
run: sbt clean

- name: Compile
run: sbt +compile

- name: Test - Compile
run: sbt +test:compile

- name: Test
run: sbt +test
26 changes: 26 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy

on:
push:
branches:
- main
release:
types:
- released

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Publish
run: sbt clean +publish
env:
AWS_ACCESS_KEY_ID: ${{ secrets.ARTIFACTS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.ARTIFACTS_SECRET_ACCESS_KEY }}
14 changes: 14 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Release Drafter

on:
push:
branches:
- main

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions .github/workflows/scala-steward.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Scala Steward

on:
workflow_dispatch:
schedule:
- cron: '0 4 * * *'

jobs:
scala-steward:
runs-on: ubuntu-latest
name: Launch Scala Steward
steps:
- name: Launch Scala Steward
uses: scala-steward-org/scala-steward-action@v2
with:
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
author-email: 60430417+dataswiftbotie@users.noreply.github.com
42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
# Scala API wrappers for the HAT

Current Version: 0.0.7

Slick PostgreSQL Code generator and Driver with useful extensions

## Usage

To use the sbt plugin in your project, add this to `plugins.sbt`:

```
resolvers += "HAT Library Artifacts Snapshots" at "https://s3-eu-west-1.amazonaws.com/library-artifacts-releases.hubofallthings.com"
addSbtPlugin("org.hatdex" % "sbt-slick-postgres-generator" % "0.0.7")
```Scala
resolvers += "HAT Library Artifacts Snapshots" at "https://s3-eu-west-1.amazonaws.com/library-artifacts-releases.hubofallthings.com"
addSbtPlugin("org.hatdex" % "sbt-slick-postgres-generator" % "X.Y.Z")
```

Similarly, for the driver library, add it to your `build.sbt`:

```
libraryDependencies += "org.hatdex" %% "slick-postgres-driver" % "0.0.7"
```Scala
libraryDependencies += "org.hatdex" %% "slick-postgres-driver" % "X.Y.Z"
```

## Publishing

To publish the library:

sbt +publish


```Bash
sbt +publish
```
28 changes: 14 additions & 14 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
import Dependencies.Library

lazy val commonSettings = Seq(
publishMavenStyle := true,
publishTo := {
val prefix = if (isSnapshot.value) "snapshots" else "releases"
Some(s"HAT Library Artifacts $prefix" at s"s3://library-artifacts-$prefix.hubofallthings.com")
},
resolvers += "HAT Library Artifacts Releases" at "https://s3-eu-west-1.amazonaws.com/library-artifacts-releases.hubofallthings.com",
resolvers += "HAT Library Artifacts Snapshots" at "https://s3-eu-west-1.amazonaws.com/library-artifacts-snapshots.hubofallthings.com"
)

lazy val driver = project.in(file("slick-postgres-driver"))
.enablePlugins(BasicSettings)
.settings(
name := "slick-postgres-driver",
crossScalaVersions := Seq("2.12.12", "2.11.12")
crossScalaVersions := Seq("2.12.12", "2.11.12"),
commonSettings
)
.settings(
libraryDependencies ++= Seq(
Expand All @@ -21,12 +32,6 @@ lazy val driver = project.in(file("slick-postgres-driver"))
Library.TestContainers.postgresql
)
)
.settings(
publishTo := {
val prefix = if (isSnapshot.value) "snapshots" else "releases"
Some(s3resolver.value("HAT Library Artifacts " + prefix, s3("library-artifacts-" + prefix + ".hubofallthings.com")) withMavenPatterns)
}
)
.configs(IntegrationTest)
.settings(
Defaults.itSettings,
Expand All @@ -39,7 +44,8 @@ lazy val plugin = project.in(file("sbt-slick-postgres-generator"))
.enablePlugins(BasicSettings)
.settings(
name := "sbt-slick-postgres-generator",
sbtPlugin := true
sbtPlugin := true,
commonSettings
)
.settings(
libraryDependencies ++= Seq(
Expand All @@ -51,12 +57,6 @@ lazy val plugin = project.in(file("sbt-slick-postgres-generator"))
Library.Slick.slickPgJoda,
Library.Slick.slickPgPlayJson)
)
.settings(
publishTo := {
val prefix = if (isSnapshot.value) "snapshots" else "releases"
Some(s3resolver.value("HAT Library Artifacts " + prefix, s3("library-artifacts-" + prefix + ".hubofallthings.com")) withMavenPatterns)
}
)
.dependsOn(driver)

lazy val genDriver = project
Expand Down
1 change: 0 additions & 1 deletion project/BuildSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ object BasicSettings extends AutoPlugin {

override def projectSettings = Seq(
organization := "org.hatdex",
version := "0.0.12",
resolvers ++= Dependencies.resolvers,
scalaVersion := Dependencies.Versions.scalaVersion,
crossScalaVersions := Dependencies.Versions.crossScala,
Expand Down
8 changes: 2 additions & 6 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
logLevel := Level.Warn

resolvers += Resolver.typesafeRepo("releases")

libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value

addSbtPlugin("com.frugalmechanic" % "fm-sbt-s3-resolver" % "0.19.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.2.2")
addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.8.1")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")

// S3 based SBT resolver
resolvers += Resolver.jcenterRepo
addSbtPlugin("ohnosequences" % "sbt-s3-resolver" % "0.18.0")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")