Skip to content

Commit

Permalink
updated Github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
clausnagel committed Sep 2, 2024
1 parent 21b44c1 commit 9832bd7
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 164 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/build-citydb-tool.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Build citydb-tool

on: [push, pull_request]
on: [ push, pull_request ]

jobs:
gradle:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
java: [17]
distribution: [temurin]
os: [ ubuntu-latest, windows-latest ]
java: [ 17 ]
distribution: [ temurin ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
Expand All @@ -18,11 +18,10 @@ jobs:
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-disabled: true
- name: Grant execute permission to Gradle
run: chmod +x ./gradlew
- name: Execute Gradle build
run: ./gradlew build
uses: gradle/gradle-build-action@v2
with:
arguments: build
cache-disabled: true
144 changes: 67 additions & 77 deletions .github/workflows/docker-build-push-edge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,80 +14,70 @@ jobs:
runs-on: ubuntu-latest

steps:
-
name: Parse short sha
uses: benjlevesque/[email protected]
id: short-sha
-
name: set lower case owner name
run: |
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
env:
OWNER: '${{ github.repository_owner }}'
-
name: Checkout repo
uses: actions/checkout@v4
-
name: Docker login Dockerhub
id: docker_login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ env.PLATFORMS }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: ${{ env.PLATFORMS }}
-
name: Extract metadata (tags, labels) for docker image
id: meta
uses: docker/metadata-action@v5
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
with:
images: |
${{ env.OWNER_LC }}/${{ env.IMAGE_NAME }}
ghcr.io/${{ env.OWNER_LC }}/${{ env.IMAGE_NAME }}
flavor: |
latest=false
tags: |
type=edge,branch=main
labels: |
maintainer=Bruno Willenborg
maintainer.email=b.willenborg(at)tum.de
maintainer.organization=Chair of Geoinformatics, Technical University of Munich (TUM)
org.opencontainers.image.authors=Bruno Willenborg
org.opencontainers.image.vendor=3DCityDB Steering Committee
org.opencontainers.image.title=3D City Database 5.0 CLI tool Docker image
org.opencontainers.image.description=3D City Database 5.0 CLI to import/export city model data and to run database operations
org.opencontainers.image.url=https://github.com/3dcitydb/
org.opencontainers.image.documentation=https://github.com/3dcitydb/citydb-tool#docker
org.opencontainers.image.source=https://github.com/3dcitydb/citydb-tool
-
name: Build and publish
uses: docker/build-push-action@v6
id: docker_build
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ env.PLATFORMS }}
build-args: |
CITYDB_TOOL_VERSION=${{ steps.short-sha.outputs.sha }}
annotations: ${{ steps.meta.outputs.annotations }}
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Parse short sha
uses: benjlevesque/[email protected]
id: short-sha
- name: set lower case owner name
run: |
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
env:
OWNER: '${{ github.repository_owner }}'
- name: Checkout repo
uses: actions/checkout@v4
- name: Docker login Dockerhub
id: docker_login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ env.PLATFORMS }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: ${{ env.PLATFORMS }}
- name: Extract metadata (tags, labels) for docker image
id: meta
uses: docker/metadata-action@v5
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
with:
images: |
${{ env.OWNER_LC }}/${{ env.IMAGE_NAME }}
ghcr.io/${{ env.OWNER_LC }}/${{ env.IMAGE_NAME }}
flavor: |
latest=false
tags: |
type=edge,branch=main
labels: |
maintainer=Bruno Willenborg
maintainer.email=b.willenborg(at)tum.de
maintainer.organization=Chair of Geoinformatics, Technical University of Munich (TUM)
org.opencontainers.image.authors=Bruno Willenborg
org.opencontainers.image.vendor=3DCityDB Steering Committee
org.opencontainers.image.title=3D City Database 5.0 CLI tool Docker image
org.opencontainers.image.description=3D City Database 5.0 CLI to import/export city model data and to run database operations
org.opencontainers.image.url=https://github.com/3dcitydb/
org.opencontainers.image.documentation=https://github.com/3dcitydb/citydb-tool#docker
org.opencontainers.image.source=https://github.com/3dcitydb/citydb-tool
- name: Build and publish
uses: docker/build-push-action@v6
id: docker_build
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ env.PLATFORMS }}
build-args: |
CITYDB_TOOL_VERSION=${{ steps.short-sha.outputs.sha }}
annotations: ${{ steps.meta.outputs.annotations }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
146 changes: 68 additions & 78 deletions .github/workflows/docker-build-push-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: docker-build-push-release
on:
workflow_dispatch:
release:
types: [published, edited]
types: [ published, edited ]
env:
IMAGE_NAME: citydb-tool
PLATFORMS: linux/amd64,linux/arm64
Expand All @@ -13,80 +13,70 @@ jobs:
runs-on: ubuntu-latest

steps:
-
name: Get release version without v
id: release_version
uses: battila7/get-version-action@v2
-
name: set lower case owner name
run: |
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
env:
OWNER: '${{ github.repository_owner }}'
-
name: Checkout repo
uses: actions/checkout@v4
-
name: Docker login Dockerhub
id: docker_login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ env.PLATFORMS }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: ${{ env.PLATFORMS }}
-
name: Extract metadata (tags, labels) for docker image
id: meta
uses: docker/metadata-action@v5
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
with:
images: |
${{ env.OWNER_LC }}/${{ env.IMAGE_NAME }}
ghcr.io/${{ env.OWNER_LC }}/${{ env.IMAGE_NAME }}
flavor: |
latest=${{ !github.event.release.prerelease }}
tags: |
type=semver,pattern={{version}}
labels: |
maintainer=Bruno Willenborg
maintainer.email=b.willenborg(at)tum.de
maintainer.organization=Chair of Geoinformatics, Technical University of Munich (TUM)
org.opencontainers.image.authors=Bruno Willenborg
org.opencontainers.image.vendor=3DCityDB Steering Committee
org.opencontainers.image.title=3D City Database 5.0 CLI tool Docker image
org.opencontainers.image.description=3D City Database 5.0 CLI to import/export city model data and to run database operations
org.opencontainers.image.url=https://github.com/3dcitydb/
org.opencontainers.image.documentation=https://github.com/3dcitydb/citydb-tool#docker
org.opencontainers.image.source=https://github.com/3dcitydb/citydb-tool
-
name: Build and publish
uses: docker/build-push-action@v6
id: docker_build
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ env.PLATFORMS }}
build-args: |
CITYDB_TOOL_VERSION=${{ steps.release_version.outputs.version }}
annotations: ${{ steps.meta.outputs.annotations }}
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Get release version without v
id: release_version
uses: battila7/get-version-action@v2
- name: set lower case owner name
run: |
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
env:
OWNER: '${{ github.repository_owner }}'
- name: Checkout repo
uses: actions/checkout@v4
- name: Docker login Dockerhub
id: docker_login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ env.PLATFORMS }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: ${{ env.PLATFORMS }}
- name: Extract metadata (tags, labels) for docker image
id: meta
uses: docker/metadata-action@v5
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
with:
images: |
${{ env.OWNER_LC }}/${{ env.IMAGE_NAME }}
ghcr.io/${{ env.OWNER_LC }}/${{ env.IMAGE_NAME }}
flavor: |
latest=${{ !github.event.release.prerelease }}
tags: |
type=semver,pattern={{version}}
labels: |
maintainer=Bruno Willenborg
maintainer.email=b.willenborg(at)tum.de
maintainer.organization=Chair of Geoinformatics, Technical University of Munich (TUM)
org.opencontainers.image.authors=Bruno Willenborg
org.opencontainers.image.vendor=3DCityDB Steering Committee
org.opencontainers.image.title=3D City Database 5.0 CLI tool Docker image
org.opencontainers.image.description=3D City Database 5.0 CLI to import/export city model data and to run database operations
org.opencontainers.image.url=https://github.com/3dcitydb/
org.opencontainers.image.documentation=https://github.com/3dcitydb/citydb-tool#docker
org.opencontainers.image.source=https://github.com/3dcitydb/citydb-tool
- name: Build and publish
uses: docker/build-push-action@v6
id: docker_build
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ env.PLATFORMS }}
build-args: |
CITYDB_TOOL_VERSION=${{ steps.release_version.outputs.version }}
annotations: ${{ steps.meta.outputs.annotations }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

0 comments on commit 9832bd7

Please sign in to comment.