Skip to content

Commit

Permalink
feat: add plugin source and ci workflows (#1)
Browse files Browse the repository at this point in the history
* feat: add existing source code

Signed-off-by: Pat Losoponkul <pat.losoponkul@iohk.io>

* chore: clean old release log

Signed-off-by: Pat Losoponkul <pat.losoponkul@iohk.io>

* ci: add ci workflows

Signed-off-by: Pat Losoponkul <pat.losoponkul@iohk.io>

* chore: remove unused env key

Signed-off-by: Pat Losoponkul <pat.losoponkul@iohk.io>

* chore: reset version.sbt

Signed-off-by: Pat Losoponkul <pat.losoponkul@iohk.io>

---------

Signed-off-by: Pat Losoponkul <pat.losoponkul@iohk.io>
  • Loading branch information
patlo-iog authored Jun 12, 2024
1 parent 034786e commit e69c1ac
Show file tree
Hide file tree
Showing 22 changed files with 7,895 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.bsp/
.idea/
target/
!target/*.jar
node_modules/
67 changes: 67 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Release

concurrency:
group: release

on:
workflow_call:
inputs:
release-branch:
required: false
type: string
default: "main"
workflow_dispatch:
inputs:
release-branch:
description: "Branch to release from"
required: false
default: "main"

jobs:
release:
env:
GITHUB_ACTOR: ${{ secrets.ATALA_GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Setup Java and Scala
uses: olafurpg/setup-scala@v14
with:
java-version: openjdk@1.17
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Cache sbt
uses: coursier/cache-action@v6.4
- uses: crazy-max/ghaction-import-gpg@v3
id: import_gpg
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
git-user-signingkey: true
git-commit-gpgsign: true
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ env.GITHUB_ACTOR }}
password: ${{ env.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Release
env:
GIT_AUTHOR_EMAIL: ${{ steps.import_gpg.outputs.email }}
GIT_COMMITTER_EMAIL: ${{ steps.import_gpg.outputs.email }}
GIT_AUTHOR_NAME: ${{ steps.import_gpg.outputs.name }}
GIT_COMMITTER_NAME: ${{ steps.import_gpg.outputs.name }}
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
run: |
npm install
npx semantic-release
27 changes: 27 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Unit tests

on:
workflow_dispatch:
push:
branches:
- "main"
pull_request:

jobs:
build-and-unit-tests:
name: "Build and unit tests"
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.title, '[skip ci]') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Setup Java and Scala
uses: olafurpg/setup-scala@v14
with:
java-version: openjdk@1.17
- name: Cache sbt
uses: coursier/cache-action@v6.4
- name: Compile and test
run: sbt compile test
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.bsp/
.idea/
target/
node_modules/
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

5 changes: 5 additions & 0 deletions Dockerfile-ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM quay.io/keycloak/keycloak:23.0.7
COPY ./target/*.jar /opt/keycloak/providers/*.jar
RUN ls /opt/keycloak/providers/
RUN /opt/keycloak/bin/kc.sh build
ENTRYPOINT [ "/opt/keycloak/bin/kc.sh" ]
Empty file added README.md
Empty file.
45 changes: 45 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
ThisBuild / organization := "org.hyperledger"
ThisBuild / autoScalaLibrary := false
ThisBuild / crossPaths := false

val V = new {
val keycloak = "23.0.7"
}

lazy val commonSettings = Seq(
githubOwner := "patlo-iog",
githubRepository := "identus-keycloak-plugins"
)

lazy val oid4vciPlugin = (project in file("."))
.settings(commonSettings)
.settings(
name := "identus-keycloak-oid4vci",
libraryDependencies ++= Seq(
"org.keycloak" % "keycloak-core" % V.keycloak % "provided",
"org.keycloak" % "keycloak-common" % V.keycloak % "provided",
"org.keycloak" % "keycloak-adapter-core" % V.keycloak % "provided",
"org.keycloak" % "keycloak-saml-core" % V.keycloak % "provided",
"org.keycloak" % "keycloak-saml-core-public" % V.keycloak % "provided",
"org.keycloak" % "keycloak-server-spi" % V.keycloak % "provided",
"org.keycloak" % "keycloak-server-spi-private" % V.keycloak % "provided",
"org.keycloak" % "keycloak-services" % V.keycloak % "provided",
)
)

lazy val root = (project in file("")).aggregate(oid4vciPlugin)

// ############################
// #### Release process #####
// ############################
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations.*
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
ReleaseStep(releaseStepTask(oid4vciPlugin / Compile / packageBin)),
publishArtifacts,
setNextVersion
)
Loading

0 comments on commit e69c1ac

Please sign in to comment.