From 35f7e47aef15c8c836ce06e2c4a140f4c55cce2a Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 23 Feb 2024 13:19:16 +0100 Subject: [PATCH 1/6] Use date-based tags for container images --- .github/workflows/ci.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c8aff91..5aa9be1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: - name: Build tilemaker run: | - mkdir ${{ github.workspace }}\build + mkdir ${{ github.workspace }}\build cd ${{ github.workspace }}\build && cmake -DTILEMAKER_BUILD_STATIC=ON -DVCPKG_TARGET_TRIPLET="x64-windows-static-md" -DCMAKE_TOOLCHAIN_FILE="c:\vcpkg\scripts\buildsystems\vcpkg.cmake" .. cd ${{ github.workspace }}\build && cmake --build . --config RelWithDebInfo @@ -49,9 +49,9 @@ jobs: ${{ github.workspace }}\build\RelWithDebInfo\tilemaker.exe ${{ github.workspace }}\build\RelWithDebInfo\*.pdb - unix-build: - strategy: - matrix: + unix-build: + strategy: + matrix: include: - os: ubuntu-22.04 triplet: x64-linux @@ -80,7 +80,7 @@ jobs: mkdir build cd build cmake -DTILEMAKER_BUILD_STATIC=ON -DCMAKE_BUILD_TYPE=Release -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} -DCMAKE_CXX_COMPILER=g++ .. - cmake --build . + cmake --build . strip tilemaker - name: Build openmaptiles-compatible mbtiles files of Liechtenstein @@ -148,7 +148,7 @@ jobs: - name: Build openmaptiles-compatible mbtiles files of given area uses: ./ with: - input: ${{ env.AREA }}.osm.pbf + input: ${{ env.AREA }}.osm.pbf output: ${{ env.AREA }}.mbtiles docker-build: @@ -174,9 +174,12 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + uses: docker/metadata-action@5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=raw,value={{date 'YYYY-MM-DDTHH-mm'}} + type=raw,value=latest - name: Build Docker image uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc From ef6d6374ca357e90eec29b14a4aa4e462b415e11 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 23 Feb 2024 13:20:27 +0100 Subject: [PATCH 2/6] Enable on branch --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5aa9be1b..60e59323 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: "Continuous Integration" on: push: - branches: [ master ] + branches: [ stable-containers ] pull_request: env: From c6031a1c988b8a681678043e7799e0b9e1f62fbf Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 23 Feb 2024 13:23:30 +0100 Subject: [PATCH 3/6] Fix syntax --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60e59323..ed278fbe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -174,12 +174,12 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@5 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=raw,value={{date 'YYYY-MM-DDTHH-mm'}} - type=raw,value=latest + tags: | + type=raw,value={{date 'YYYY-MM-DDTHH-mm'}} + type=raw,value=latest - name: Build Docker image uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc From b777e5c752c62dce1045347ea351fee7bf68dc19 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 23 Feb 2024 13:42:40 +0100 Subject: [PATCH 4/6] Build on graph --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed278fbe..1c91bba5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -183,7 +183,7 @@ jobs: - name: Build Docker image uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - if: ${{ github.ref != 'refs/heads/master'}} + if: ${{ github.ref != 'refs/heads/stable-containers'}} with: context: . push: false @@ -191,7 +191,7 @@ jobs: labels: ${{ steps.meta.outputs.labels }} - name: Build and push Docker image uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - if: ${{ github.ref == 'refs/heads/master'}} + if: ${{ github.ref == 'refs/heads/stable-containers'}} with: context: . push: true From a892bfce5b749b0ddeb50b64efca532288cea4b3 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 23 Feb 2024 13:49:13 +0100 Subject: [PATCH 5/6] Revert to master --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c91bba5..db45efaf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: "Continuous Integration" on: push: - branches: [ stable-containers ] + branches: [ master ] pull_request: env: @@ -183,7 +183,7 @@ jobs: - name: Build Docker image uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - if: ${{ github.ref != 'refs/heads/stable-containers'}} + if: ${{ github.ref != 'refs/heads/master'}} with: context: . push: false @@ -191,7 +191,7 @@ jobs: labels: ${{ steps.meta.outputs.labels }} - name: Build and push Docker image uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - if: ${{ github.ref == 'refs/heads/stable-containers'}} + if: ${{ github.ref == 'refs/heads/master'}} with: context: . push: true From 9e23ca502ea5043e2787b20c410adcb63dc9debe Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Fri, 23 Feb 2024 14:44:27 +0100 Subject: [PATCH 6/6] Trigger CI --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db45efaf..d77b75f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -189,6 +189,7 @@ jobs: push: false tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + - name: Build and push Docker image uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc if: ${{ github.ref == 'refs/heads/master'}}