v17.11.4 (#2388) #798
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Create Release | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - 'v*' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| DOCKER_IMAGE_NAME: schemacrawler/schemacrawler | |
| DOCKER_IMAGE_TAG: latest | |
| DOCKERFILE_PATH: ./schemacrawler-distrib/Dockerfile | |
| DOCKER_CONTEXT_PATH: ./schemacrawler-distrib/target/_expanded-distribution/ | |
| jobs: | |
| release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # Required for OIDC authentication | |
| contents: write # Required to create a new tag | |
| steps: | |
| # VALIDATE TAGS | |
| - id: validate-semver | |
| name: Validate tag against semantic versioning | |
| if: startsWith(github.ref, 'refs/tags/') | |
| shell: bash | |
| run: | | |
| SEMVER_PATTERN="^refs/tags/v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$" | |
| if [[ ! $GITHUB_REF =~ $SEMVER_PATTERN ]] | |
| then | |
| echo "Tag $GITHUB_REF does not follow semantic versioning" | |
| exit 1 | |
| fi | |
| # SETUP BUILD ENVIRONMENT | |
| - id: prepare-maven-build | |
| name: Prepare Maven build | |
| uses: sualeh/prepare-maven-build@v1.7.2 | |
| with: | |
| java-version: 17 | |
| gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
| - id: install-graphviz | |
| name: Install Graphviz | |
| uses: sualeh/install-graphviz@v1.0.3 | |
| # BUILD FOR DISTRIBUTION | |
| - id: build | |
| name: Build and test for distribution | |
| shell: bash | |
| run: | | |
| # Build | |
| # ... and install (for later phase of Docker image tests) | |
| mvn \ | |
| --no-transfer-progress \ | |
| --batch-mode \ | |
| -Ddistrib \ | |
| clean install | |
| - id: show-distrib | |
| name: Show distribution directory | |
| shell: bash | |
| run: | | |
| # Show distribution directory | |
| echo "Show distribution directory" | |
| ls -1R ./schemacrawler-distrib/target/_expanded-distribution | |
| # CREATE GITHUB RELEASE AND ADD ASSETS | |
| - id: upload-artifacts | |
| name: Upload artifacts for the release | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: release-artifacts-v17.11.4 | |
| path: | | |
| ./schemacrawler-distrib/target/schemacrawler-17.11.4-bin.zip | |
| ./schemacrawler-distrib/target/schemacrawler-17.11.4-bin.zip.SHA-512 | |
| retention-days: 2 | |
| - id: create-release | |
| name: Create GitHub release | |
| uses: softprops/action-gh-release@v3 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| name: ${{ github.ref_name }} | |
| draft: false | |
| prerelease: false | |
| body: | | |
| SchemaCrawler ${{ github.event.release.tag_name }} release at last commit ${{ github.sha }} | |
| See the change history at https://www.schemacrawler.com/changes-report.html | |
| generate_release_notes: true | |
| files: | | |
| ./schemacrawler-distrib/target/schemacrawler-17.11.4-bin.zip | |
| ./schemacrawler-distrib/target/schemacrawler-17.11.4-bin.zip.SHA-512 | |
| overwrite_files: true | |
| # BUILD AND PUBLISH DOCKER IMAGE | |
| - id: setup-qemu | |
| name: Setup QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| - id: setup-buildx | |
| name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - id: docker-login | |
| name: Log into Docker Hub | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - id: validate-build-configuration | |
| name: Validate build configuration | |
| uses: docker/build-push-action@v7 | |
| with: | |
| call: check | |
| file: ${{ env.DOCKERFILE_PATH }} | |
| context: ${{ env.DOCKER_CONTEXT_PATH }} | |
| load: false | |
| push: false | |
| - id: meta | |
| name: Set up Docker metadata | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: | | |
| ${{ env.DOCKER_IMAGE_NAME }} | |
| tags: | | |
| type=raw,value=${{ env.DOCKER_IMAGE_TAG }},priority=1200 | |
| type=raw,value={{ tag }},priority=1190 | |
| type=semver,pattern=v{{version}},priority=940 | |
| type=semver,pattern={{version}},priority=930 | |
| type=semver,pattern={{major}}.{{minor}},priority=920 | |
| type=semver,pattern={{major}},priority=910 | |
| labels: | | |
| maintainer=Sualeh Fatehi <sualeh@hotmail.com> | |
| org.opencontainers.image.authors=Sualeh Fatehi <sualeh@hotmail.com> | |
| org.opencontainers.image.vendor=SchemaCrawler | |
| org.opencontainers.image.licenses=(EPL-2.0) | |
| org.opencontainers.image.url=https://www.schemacrawler.com/ | |
| org.opencontainers.image.documentation=https://github.com/schemacrawler/SchemaCrawler-Usage | |
| - id: build-docker-image | |
| name: Build Docker image locally | |
| uses: docker/build-push-action@v7 | |
| with: | |
| call: build | |
| file: ${{ env.DOCKERFILE_PATH }} | |
| context: ${{ env.DOCKER_CONTEXT_PATH }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| # Build just for runner platform | |
| platforms: linux/amd64 | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| annotations: ${{ steps.meta.outputs.annotations }} | |
| load: true | |
| push: false | |
| - id: test-docker-image | |
| name: Test Docker image build | |
| shell: bash | |
| run: | | |
| # Run the Testcontainers integration test | |
| # This will pull the Docker image, start and verify it | |
| mvn \ | |
| --no-transfer-progress \ | |
| --batch-mode \ | |
| -Dverify \ | |
| -Ddocker_image_tag=${{ env.DOCKER_IMAGE_TAG }} \ | |
| -pl schemacrawler-verify \ | |
| test | |
| - id: push-docker-image | |
| name: Build and push Docker image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| call: build | |
| file: ${{ env.DOCKERFILE_PATH }} | |
| context: ${{ env.DOCKER_CONTEXT_PATH }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| platforms: |- | |
| linux/amd64 | |
| linux/arm64 | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| annotations: ${{ steps.meta.outputs.annotations }} | |
| sbom: true | |
| provenance: true | |
| load: false | |
| push: true | |
| # PUBLISH TO CENTRAL REPOSITORY | |
| - id: publish-to-central | |
| name: Publish to Central Repository | |
| if: startsWith(github.ref, 'refs/tags/') | |
| env: | |
| MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }} | |
| MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} | |
| MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| shell: bash | |
| run: | | |
| # Publish to Central Repository | |
| export GPG_TTY=$(tty) | |
| mvn \ | |
| --no-transfer-progress \ | |
| --batch-mode \ | |
| -Ddistrib \ | |
| -Dmaven.javadoc.skip=false \ | |
| -Dskip.signing.artifacts=false \ | |
| clean deploy |