Skip to content

Merge pull request #12400 from swagger-api/CodeQl_Sarif_Filter-apply #73

Merge pull request #12400 from swagger-api/CodeQl_Sarif_Filter-apply

Merge pull request #12400 from swagger-api/CodeQl_Sarif_Filter-apply #73

Workflow file for this run

name: Build - master
on:
push:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 11 ]
steps:
- uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: temurin
cache: maven
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker Login
run: |
docker login --username=${{ secrets.DOCKERHUB_SB_USERNAME }} --password=${{ secrets.DOCKERHUB_SB_PASSWORD }}
set -e
- 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 -B -U verify --file pom.xml
- name: Deploy Maven Snapshot
if: ${{ matrix.java == 11 }}
run: |
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`
echo "POM VERSION" ${MY_POM_VERSION}
if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]];
then
echo "SNAP=true" >> "$GITHUB_ENV"
./mvnw clean deploy -U --settings $HOME/.m2/settings.xml
else
echo "not deploying release nor building and pushing release docker image: " ${MY_POM_VERSION}
fi
- name: Build generator image and push
uses: docker/build-push-action@v5
if: env.SNAP == 'true'
with:
context: ./modules/swagger-generator
push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
provenance: false
tags: swaggerapi/swagger-generator:unstable
- name: Build CLI image and push
uses: docker/build-push-action@v5
if: env.SNAP == 'true'
with:
context: ./modules/swagger-codegen-cli
push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
provenance: false
tags: swaggerapi/swagger-codegen-cli:unstable
build-java8:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 8 ]
steps:
- uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn -B -U clean verify -DskipTests -Dmaven.test.skip=true -Dmaven.site.skip=true -Dmaven.javadoc.skip=true -Psamples-java8 --file pom.xml