@@ -23,16 +23,19 @@ jobs:
2323 password : ${{ secrets.DOCKER_PASSWORD }}
2424 - name : Setup variables
2525 run : |
26- export cli_version=$(\./mvnw -o org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\[');
27- export build_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ");
28- export DOCKER_GENERATOR_IMAGE_NAME=openapitools/openapi-generator-online
29- export DOCKER_CODEGEN_CLI_IMAGE_NAME=openapitools/openapi-generator-cli
26+ # set as GitHub ENV variables
27+ echo "cli_version=$(\./mvnw -o org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\[')" >> $GITHUB_ENV
28+ echo "build_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV
29+ echo "DOCKER_GENERATOR_IMAGE_NAME=openapitools/openapi-generator-online" >> $GITHUB_ENV
30+ echo "build_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV
31+
3032 - name : Publish openapi-generator-online snapshot version
3133 if : github.ref_type != 'tag' # not tag (release)
3234 run : |
33- docker buildx create --use && docker buildx build --push --platform linux/amd64,linux/arm64 --label=org.opencontainers.image.created=$build_date --label=org.opencontainers.image.title=openapi-generator-online --label=org.opencontainers.image.revision=$GITHUB_SHA --label=org.opencontainers.image.version=$cli_version -t $DOCKER_GENERATOR_IMAGE_NAME ./modules/openapi-generator-online;
35+ docker buildx create --use
36+ docker buildx build --push --platform linux/amd64,linux/arm64 --label=org.opencontainers.image.created=${{ env.build_date }} --label=org.opencontainers.image.title=openapi-generator-online --label=org.opencontainers.image.revision=$GITHUB_SHA --label=org.opencontainers.image.version=${{ env.cli_version }} -t ${{ env.DOCKER_GENERATOR_IMAGE_NAME }} ./modules/openapi-generator-online
3437 - name : Publish openapi-generator-online stable version
3538 if : github.ref_type == 'tag' # tagged (release)
3639 run : |
3740 docker buildx create --use
38- docker buildx build --push --platform linux/amd64,linux/arm64 --label=org.opencontainers.image.created=$build_date --label=org.opencontainers.image.title=openapi-generator-online --label=org.opencontainers.image.revision=$GITHUB_SHA --label=org.opencontainers.image.version=$cli_version -t $DOCKER_GENERATOR_IMAGE_NAME:latest -t $DOCKER_GENERATOR_IMAGE_NAME:${{ github.ref_name }} -t $DOCKER_GENERATOR_IMAGE_NAME -t $DOCKER_GENERATOR_IMAGE_NAME:latest-release ./modules/openapi-generator-online;
41+ docker buildx build --push --platform linux/amd64,linux/arm64 --label=org.opencontainers.image.created=${{ env. build_date }} --label=org.opencontainers.image.title=openapi-generator-online --label=org.opencontainers.image.revision=$GITHUB_SHA --label=org.opencontainers.image.version=${{ env. cli_version }} -t ${{ env. DOCKER_GENERATOR_IMAGE_NAME }} :latest -t ${{ env. DOCKER_GENERATOR_IMAGE_NAME }} :${{ github.ref_name }} -t ${{ env. DOCKER_GENERATOR_IMAGE_NAME }} -t ${{ env. DOCKER_GENERATOR_IMAGE_NAME }} :latest-release ./modules/openapi-generator-online
0 commit comments