Skip to content

Commit

Permalink
remove server publication
Browse files Browse the repository at this point in the history
  • Loading branch information
beetlecrunch committed Jul 15, 2024
1 parent 0c07d7e commit 9c5c3c1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 122 deletions.
69 changes: 1 addition & 68 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,58 +16,6 @@ env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
build:
name: Build and Test
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.10]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 11

- name: Cache sbt
uses: actions/cache@v2
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
~/AppData/Local/Coursier/Cache/v1
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Install node 16
uses: actions/setup-node@v3
with:
node-version: 16

- name: Installing openapi-generator-cli
run: npm install -g @openapitools/openapi-generator-cli

- name: Build project
run: sbt ++${{ matrix.scala }} test

- name: Compress target directories
run: tar cf targets.tar target generated/target client/target project/target

- name: Upload target directories
uses: actions/upload-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
path: targets.tar

publish:
name: Publish Artifacts
Expand Down Expand Up @@ -143,20 +91,5 @@ jobs:
run: sbt ++${{ matrix.scala }} generateCode

- name: Publish project
run: sbt ++${{ matrix.scala }} publish
run: sbt ++${{ matrix.scala }} "project client" publish

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: eu-central-1
role-to-assume: 'arn:aws:iam::505630707203:role/interop-github-ecr-dev'
role-session-name: interop-be-catalog-process-${{ github.job }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Build, tag, and push image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
run: 'sbt ++${{ matrix.scala }} docker:publish'
29 changes: 0 additions & 29 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,6 @@ projectName := name.value
generateCode := {
import sys.process._

Process(s"""openapi-generator-cli generate -t template/scala-akka-http-server
| -i src/main/resources/interface-specification.yml
| -g scala-akka-http-server
| -p projectName=${projectName.value}
| -p invokerPackage=it.pagopa.${packagePrefix.value}.server
| -p modelPackage=it.pagopa.${packagePrefix.value}.model
| -p apiPackage=it.pagopa.${packagePrefix.value}.api
| -p dateLibrary=java8
| -p entityStrictnessTimeout=15
| -o generated""".stripMargin).!!

Process(s"""openapi-generator-cli generate -t template/scala-akka-http-client
| -i src/main/resources/interface-specification.yml
| -g scala-akka
Expand All @@ -55,10 +44,6 @@ generateCode := {
(Compile / compile) := ((Compile / compile) dependsOn generateCode).value
(Test / test) := ((Test / test) dependsOn generateCode).value

cleanFiles += baseDirectory.value / "generated" / "src"

cleanFiles += baseDirectory.value / "generated" / "target"

cleanFiles += baseDirectory.value / "client" / "src"

cleanFiles += baseDirectory.value / "client" / "target"
Expand All @@ -69,19 +54,6 @@ runStandalone := {
(Compile / run).evaluated
}

lazy val generated = project
.in(file("generated"))
.settings(
scalacOptions := Seq(),
scalafmtOnCompile := true,
libraryDependencies := Dependencies.Jars.`server`,
publish / skip := true,
publish := (()),
publishLocal := (()),
publishTo := None
)
.setupBuildInfo

lazy val client = project
.in(file("client"))
.settings(
Expand Down Expand Up @@ -110,7 +82,6 @@ lazy val root = (project in file("."))
dockerCommands += Cmd("LABEL", s"org.opencontainers.image.source https://github.com/pagopa/${name.value}")
)
.aggregate(client)
.dependsOn(generated)
.enablePlugins(JavaAppPackaging)
.enablePlugins(DockerPlugin)
.enablePlugins(NoPublishPlugin)
Expand Down
25 changes: 0 additions & 25 deletions generated/.openapi-generator-ignore

This file was deleted.

0 comments on commit 9c5c3c1

Please sign in to comment.