Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions .github/workflows/docker_transport_service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,23 @@ jobs:

- name: Set tag for push
if: github.event_name == 'push'
run: echo "TAG1=$IMAGE_NAME:edge" >> $GITHUB_ENV
run: |
echo "WM_TRANSPORT_VERSION=0.0.0.dev0.git+${{ github.sha }}" >> $GITHUB_ENV
echo "TAG1=$IMAGE_NAME:edge" >> $GITHUB_ENV

- name: Set tag for manually triggered
if: github.event_name == 'workflow_dispatch'
run: echo "TAG1=$IMAGE_NAME:${{ github.event.inputs.tag }}" >> $GITHUB_ENV
run: |
VERSION="${{ github.event.inputs.tag }}"
echo "WM_TRANSPORT_VERSION=${VERSION#v}" >> $GITHUB_ENV
echo "TAG1=$IMAGE_NAME:${VERSION}" >> $GITHUB_ENV

- name: Set tag for release version
if: github.event_name == 'release'
run: echo "TAG1=$IMAGE_NAME:${{ github.event.release.tag_name }}" >> $GITHUB_ENV
run: |
VERSION="${{ github.event.release.tag_name }}"
echo "WM_TRANSPORT_VERSION=${VERSION#v}" >> $GITHUB_ENV
echo "TAG1=$IMAGE_NAME:${VERSION}" >> $GITHUB_ENV

- name: Set additionnal latest tag also for official release
if: github.event_name == 'release' && !contains(github.event.release.tag_name, 'rc')
Expand All @@ -63,7 +71,9 @@ jobs:
file: docker/transport_service/Dockerfile
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/arm/v6
push: true
build-args: GATEWAY_BUILD_SHA1= ${{ github.sha }}
build-args: |
GATEWAY_BUILD_SHA1=${{ github.sha }}
WM_TRANSPORT_VERSION=${{ env.WM_TRANSPORT_VERSION }}
tags: |
${{ env.TAG1 }}
${{ env.TAG2 }}
17 changes: 17 additions & 0 deletions .github/workflows/release_artefacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
release:
types: [created]
workflow_dispatch:
inputs:
version:
description: 'Version to use'
required: true

jobs:
build:
Expand All @@ -17,6 +21,18 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Set version for manually triggered
if: github.event_name == 'workflow_dispatch'
run: |
VERSION="${{ github.event.inputs.version }}"
echo "WM_TRANSPORT_VERSION=${VERSION#v}" >> $GITHUB_ENV

- name: Set version for release
if: github.event_name == 'release'
run: |
VERSION="${{ github.event.release.tag_name }}"
echo "WM_TRANSPORT_VERSION=${VERSION#v}" >> $GITHUB_ENV

- name: Build and extract transportService wheel
uses: docker/build-push-action@v6
with:
Expand All @@ -25,6 +41,7 @@ jobs:
platforms: linux/amd64
push: false
target: export
build-args: WM_TRANSPORT_VERSION=${{ env.WM_TRANSPORT_VERSION }}
outputs: ./artifacts/transportService/

- name: Move transport service wheel
Expand Down
4 changes: 4 additions & 0 deletions docker/transport_service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
ARG BASE_IMAGE=python:3.13-alpine3.21
ARG WM_TRANSPORT_VERSION=0.0.0.dev0

FROM $BASE_IMAGE AS builder
ARG WM_TRANSPORT_VERSION
ENV WM_TRANSPORT_VERSION=$WM_TRANSPORT_VERSION

RUN adduser --disabled-password wirepas

Expand Down
8 changes: 6 additions & 2 deletions python_transport/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,17 @@ def get_systemd_lib(key):
return None


def get_version():
return os.environ.get("WM_TRANSPORT_VERSION", "0.0.0.dev0")


about = {}
with open(get_absolute_path("./wirepas_gateway/__about__.py")) as f:
exec(f.read(), about)

setup(
name=about["__pkg_name__"],
version=about["__version__"],
version=get_version(),
description=about["__description__"],
long_description=long_description,
long_description_content_type="text/markdown",
Expand All @@ -84,7 +88,7 @@ def get_systemd_lib(key):
keywords=about["__keywords__"],
packages=find_packages(exclude=["contrib", "docs", "tests", "examples"]),
install_requires=get_requirements("requirements.txt"),
python_requires=">=3.7",
python_requires=">=3.8",
ext_modules=[
Extension(
"dbusCExtension",
Expand Down
2 changes: 1 addition & 1 deletion python_transport/wirepas_gateway/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
__pkg_name__ = "wirepas_gateway"
__title__ = "Wirepas Gateway Transport Service"
__url__ = "https://github.com/wirepas/gateway"
__version__ = "1.6.0rc1"
__keywords__ = "wirepas connectivity iot mesh"

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line at end of file

5 changes: 4 additions & 1 deletion python_transport/wirepas_gateway/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from . import dbus
from . import protocol
from . import utils
import importlib.metadata

from .__about__ import (
__author__,
Expand All @@ -25,6 +26,8 @@
__pkg_name__,
__title__,
__url__,
__version__,
__keywords__,
)

__version__ = importlib.metadata.version(__pkg_name__)

Loading