Add synapse version as Docker container label (#15972)

Co-authored-by: Mo Balaa <balaa@fractalnetworks.co>
pull/16009/head
Mo Balaa 2023-07-26 11:16:12 -05:00 committed by GitHub
parent 6dc019d9dd
commit 96529c4236
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -29,6 +29,10 @@ jobs:
- name: Inspect builder
run: docker buildx inspect
- name: Extract version from pyproject.toml
run: |
echo "SYNAPSE_VERSION=$(grep "^version" pyproject.toml | sed -E 's/version\s*=\s*["]([^"]*)["]/\1/')" >> $GITHUB_ENV
- name: Log in to DockerHub
uses: docker/login-action@v2
with:
@ -61,7 +65,9 @@ jobs:
uses: docker/build-push-action@v4
with:
push: true
labels: "gitsha1=${{ github.sha }}"
labels: |
gitsha1=${{ github.sha }}
org.opencontainers.image.version=${{ env.SYNAPSE_VERSION }}
tags: "${{ steps.set-tag.outputs.tags }}"
file: "docker/Dockerfile"
platforms: linux/amd64,linux/arm64

1
changelog.d/15972.docker Normal file
View File

@ -0,0 +1 @@
Add `org.opencontainers.image.version` labels to Docker containers [published by Matrix.org](https://hub.docker.com/r/matrixdotorg/synapse). Contributed by Mo Balaa.