From 9c5c3c198c36d5dbe03af6c2115dd9cdff97112d Mon Sep 17 00:00:00 2001 From: Stefano Perazzolo <13318704+beetlecrunch@users.noreply.github.com> Date: Mon, 15 Jul 2024 17:09:40 +0200 Subject: [PATCH] remove server publication --- .github/workflows/ci.yml | 69 +---------------------------- build.sbt | 29 ------------ generated/.openapi-generator-ignore | 25 ----------- 3 files changed, 1 insertion(+), 122 deletions(-) delete mode 100644 generated/.openapi-generator-ignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0790a662..a43c8881 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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' diff --git a/build.sbt b/build.sbt index 820ac537..6470c1ad 100644 --- a/build.sbt +++ b/build.sbt @@ -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 @@ -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" @@ -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( @@ -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) diff --git a/generated/.openapi-generator-ignore b/generated/.openapi-generator-ignore deleted file mode 100644 index 8da5a93f..00000000 --- a/generated/.openapi-generator-ignore +++ /dev/null @@ -1,25 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md -build.sbt -README.md