Skip to content

Commit

Permalink
CI and dependency management upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
frantuma committed Nov 21, 2023
1 parent 953805c commit a9f1fa6
Show file tree
Hide file tree
Showing 10 changed files with 328 additions and 1,502 deletions.
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: "maven"
target-branch: "master"
directory: "/"
schedule:
interval: "daily"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
- package-ecosystem: "maven"
target-branch: "3.0.0"
directory: "/"
schedule:
interval: "daily"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
16 changes: 16 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: Dependency Review
uses: actions/dependency-review-action@v3
with:
fail-on-severity: high
68 changes: 68 additions & 0 deletions .github/workflows/docker-release-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build And Push Docker Release Master

on:
workflow_dispatch:
branches: [ "master" ]
inputs:
tag:
description: tag/version to release
required: true
jobs:
build_push_docker_release_master:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
name: git checkout master
with:
ref: master
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: maven
- name: preliminary checks
run: |
docker login --username=${{ secrets.DOCKERHUB_SB_USERNAME }} --password=${{ secrets.DOCKERHUB_SB_PASSWORD }}
set -e
# fail if templates/generators contain carriage return '\r'
/bin/bash ./bin/utils/detect_carriage_return.sh
# fail if generators contain merge conflicts
/bin/bash ./bin/utils/detect_merge_conflict.sh
# fail if generators contain tab '\t'
/bin/bash ./bin/utils/detect_tab_in_java_class.sh
- uses: s4u/[email protected]
name: setup maven settings.xml
with:
servers: |
[{
"id": "sonatype-nexus-staging",
"username": "${{ secrets.OSSRH_USERNAME }}",
"password": "${{ secrets.OSSRH_TOKEN }}"
},
{
"id": "sonatype-nexus-snapshots",
"username": "${{ secrets.OSSRH_USERNAME }}",
"password": "${{ secrets.OSSRH_TOKEN }}"
}]
- name: Build with Maven
run: |
# mvn clean install -U
- name: docker build and push
run: |
export DOCKER_GENERATOR_IMAGE_NAME=swaggerapi/swagger-generator
export DOCKER_CODEGEN_CLI_IMAGE_NAME=swaggerapi/swagger-codegen-cli
export MY_POM_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec`
docker build --rm=false -t $DOCKER_GENERATOR_IMAGE_NAME:${{ env.TAG }} ./modules/swagger-generator
docker tag $DOCKER_GENERATOR_IMAGE_NAME:${{ env.TAG }} $DOCKER_GENERATOR_IMAGE_NAME:latest
docker push $DOCKER_GENERATOR_IMAGE_NAME:${{ env.TAG }}
docker push $DOCKER_GENERATOR_IMAGE_NAME:latest
docker build --rm=false -t $DOCKER_CODEGEN_CLI_IMAGE_NAME:${{ env.TAG }} ./modules/swagger-codegen-cli
docker tag $DOCKER_CODEGEN_CLI_IMAGE_NAME:${{ env.TAG }} $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest
docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME:${{ env.TAG }}
docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest
env:
TAG: ${{ github.event.inputs.tag }}
2 changes: 1 addition & 1 deletion .github/workflows/maven-master-pulls.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: PR build - master

on:
pull_request:
c:
branches: [ "master" ]

jobs:
Expand Down
2 changes: 1 addition & 1 deletion modules/swagger-codegen-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.4</version>
<version>3.10.2</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
Expand Down
2 changes: 1 addition & 1 deletion modules/swagger-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,6 @@
<servlet-api-version>2.5</servlet-api-version>
<zip-version>2.11.5</zip-version>
<jetty-version>9.4.53.v20231009</jetty-version>
<jersey2-version>2.40</jersey2-version>
<jersey2-version>2.41</jersey2-version>
</properties>
</project>
Loading

0 comments on commit a9f1fa6

Please sign in to comment.