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 d5def59 commit faa806a
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 62 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/citygml-tools-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,23 @@ jobs:
build:
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
distribution: ["temurin"]
version: ["11"]
os: [ "macos-latest", "ubuntu-latest", "windows-latest" ]
distribution: [ "temurin" ]
version: [ "11" ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.version }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup Gradle execute Gradle 'build' task
uses: gradle/gradle-build-action@v2
with:
arguments: build
cache-disabled: true
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.version }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup Gradle execute Gradle 'build' task
uses: gradle/gradle-build-action@v2
with:
arguments: build
cache-disabled: true
36 changes: 13 additions & 23 deletions .github/workflows/docker-build-and-push-edge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,45 +13,37 @@ jobs:
build-push:
runs-on: ubuntu-latest
steps:
-
name: Parse short sha
uses: benjlevesque/[email protected]
- name: Parse short sha
uses: benjlevesque/[email protected]
id: short-sha
-
name: set lower case owner name
- name: set lower case owner name
run: |
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
env:
OWNER: '${{ github.repository_owner }}'
-
name: Checkout repo
- name: Checkout repo
uses: actions/checkout@v4
-
name: Docker login Dockerhub
- name: Docker login Dockerhub
id: docker_login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
- 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
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ env.PLATFORMS }}
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: ${{ env.PLATFORMS }}
-
name: Extract metadata (tags, labels) for docker image
- name: Extract metadata (tags, labels) for docker image
id: meta
uses: docker/metadata-action@v5
with:
Expand All @@ -71,9 +63,8 @@ jobs:
org.opencontainers.image.url=https://github.com/citygml4j/citygml-tools
org.opencontainers.image.documentation=https://github.com/citygml4j/citygml-tools#docker
org.opencontainers.image.source=https://github.com/citygml4j/citygml-tools
-
name: Build and publish
uses: docker/build-push-action@v5
- name: Build and publish
uses: docker/build-push-action@v6
id: docker_build
with:
push: true
Expand All @@ -82,6 +73,5 @@ jobs:
platforms: ${{ env.PLATFORMS }}
build-args: |
CITYGML_TOOLS_VERSION=${{ steps.short-sha.outputs.sha }}
-
name: Image digest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
36 changes: 13 additions & 23 deletions .github/workflows/docker-build-and-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: citygml-tools
PLATFORMS: linux/amd64,linux/arm64
Expand All @@ -12,45 +12,37 @@ jobs:
build-push:
runs-on: ubuntu-latest
steps:
-
name: Get release version without v
- name: Get release version without v
id: release_version
uses: battila7/get-version-action@v2
-
name: set lower case owner name
- name: set lower case owner name
run: |
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
env:
OWNER: '${{ github.repository_owner }}'
-
name: Checkout repo
- name: Checkout repo
uses: actions/checkout@v4
-
name: Docker login Dockerhub
- name: Docker login Dockerhub
id: docker_login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
- 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
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ env.PLATFORMS }}
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: ${{ env.PLATFORMS }}
-
name: Extract metadata (tags, labels) for docker image
- name: Extract metadata (tags, labels) for docker image
id: meta
uses: docker/metadata-action@v5
with:
Expand All @@ -70,9 +62,8 @@ jobs:
org.opencontainers.image.url=https://github.com/citygml4j/citygml-tools
org.opencontainers.image.documentation=https://github.com/citygml4j/citygml-tools#docker
org.opencontainers.image.source=https://github.com/citygml4j/citygml-tools
-
name: Build and publish
uses: docker/build-push-action@v5
- name: Build and publish
uses: docker/build-push-action@v6
id: docker_build
with:
push: true
Expand All @@ -81,6 +72,5 @@ jobs:
platforms: ${{ env.PLATFORMS }}
build-args: |
CITYGML_TOOLS_VERSION=${{ steps.release_version.outputs.version }}
-
name: Image digest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

0 comments on commit faa806a

Please sign in to comment.