-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add required build, Dependencies and github workflows
- Loading branch information
1 parent
fd2fc72
commit 9fa1432
Showing
9 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Deploy if not a version bump PR | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.pull_request.merged == true && !contains(github.event.pull_request.labels.*.name, 'Version bump') }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: gh workflow run deploy.yml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.WORKFLOW_PAT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: TDR Deploy Metadata Validation | ||
on: | ||
workflow_dispatch: | ||
jobs: | ||
deploy: | ||
uses: nationalarchives/tdr-github-actions/.github/workflows/sbt_release.yml@main | ||
with: | ||
library-name: "AWS utils" | ||
secrets: | ||
WORKFLOW_PAT: ${{ secrets.WORKFLOW_PAT }} | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | ||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: TDR Run Tests | ||
on: | ||
pull_request: | ||
push: | ||
branches-ignore: | ||
- master | ||
- release-* | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: nationalarchives/tdr-github-actions/.github/actions/run-git-secrets@main | ||
- uses: nationalarchives/tdr-github-actions/.github/actions/slack-send@main | ||
if: failure() | ||
with: | ||
message: ":warning: Secrets found in repository ${{ inputs.repo-name }}" | ||
slack-url: ${{ secrets.SLACK_WEBHOOK }} | ||
- name: Run tests | ||
run: sbt test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import Dependencies._ | ||
import sbt.url | ||
import sbtrelease.ReleaseStateTransformations.{checkSnapshotDependencies, commitNextVersion, commitReleaseVersion, inquireVersions, pushChanges, runClean, runTest, setNextVersion, setReleaseVersion, tagRelease} | ||
|
||
|
||
ThisBuild / organization := "uk.gov.nationalarchives" | ||
ThisBuild / organizationName := "National Archives" | ||
|
||
scalaVersion := "2.13.11" | ||
version := version.value | ||
|
||
|
||
ThisBuild / scmInfo := Some( | ||
ScmInfo( | ||
url("https://github.com/nationalarchives/tdr-metadata-validation"), | ||
"[email protected]:nationalarchives/tdr-metadata-validation.git" | ||
) | ||
) | ||
|
||
developers := List( | ||
Developer( | ||
id = "tna-digital-archiving-jenkins", | ||
name = "TNA Digital Archiving", | ||
email = "[email protected]", | ||
url = url("https://github.com/nationalarchives/tdr-metadata-validation") | ||
) | ||
) | ||
|
||
ThisBuild / description := "A library to validate input metadata for the Transfer Digital Records" | ||
ThisBuild / licenses := List("MIT" -> new URL("https://choosealicense.com/licenses/mit/")) | ||
ThisBuild / homepage := Some(url("https://github.com/nationalarchives/tdr-metadata-validation")) | ||
|
||
useGpgPinentry := true | ||
publishTo := sonatypePublishToBundle.value | ||
publishMavenStyle := true | ||
|
||
releaseProcess := Seq[ReleaseStep]( | ||
checkSnapshotDependencies, | ||
inquireVersions, | ||
runClean, | ||
runTest, | ||
setReleaseVersion, | ||
commitReleaseVersion, | ||
tagRelease, | ||
releaseStepCommand("publishSigned"), | ||
releaseStepCommand("sonatypeBundleRelease"), | ||
setNextVersion, | ||
commitNextVersion, | ||
pushChanges | ||
) | ||
|
||
resolvers += | ||
"Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots" | ||
|
||
lazy val root = (project in file(".")) | ||
.settings( | ||
name := "tdr-metadata-validation", | ||
libraryDependencies ++= Seq( | ||
scalaTest % Test, | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import sbt._ | ||
|
||
object Dependencies { | ||
lazy val scalaTest = "org.scalatest" %% "scalatest" % "3.2.12" | ||
lazy val mockito = "org.mockito" %% "mockito-scala" % "1.17.7" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt.version=1.9.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0") | ||
resolvers += Resolver.jcenterRepo | ||
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.21") | ||
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ThisBuild / version := "0.0.1-SNAPSHOT" |