Skip to content
Merged
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
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ jobs:
python -m pip install --upgrade pip
pip install build

- name: Set package version (tags only)
if: startsWith(github.ref, 'refs/tags/v')
run: echo "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_MESHCORE_PROXY=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"

- name: Build packages
run: python -m build

Expand Down Expand Up @@ -131,6 +135,9 @@ jobs:
type=ref,event=tag
type=raw,value=latest

- name: Set image version
run: echo "MESHCORE_PROXY_VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"

- name: Build and push image
uses: docker/build-push-action@v5
with:
Expand All @@ -139,3 +146,5 @@ jobs:
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
MESHCORE_PROXY_VERSION=${{ env.MESHCORE_PROXY_VERSION }}
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ LABEL org.opencontainers.image.source="https://github.com/rgregg/meshcore-proxy"
LABEL org.opencontainers.image.description="TCP proxy for MeshCore companion radios"
LABEL org.opencontainers.image.licenses="MIT"

ARG MESHCORE_PROXY_VERSION

# Install system dependencies for BLE support
RUN apt-get update && apt-get install -y --no-install-recommends \
bluez \
Expand All @@ -23,6 +25,7 @@ COPY pyproject.toml README.md ./
COPY src/ ./src/

# Install the package
ENV SETUPTOOLS_SCM_PRETEND_VERSION_FOR_MESHCORE_PROXY=${MESHCORE_PROXY_VERSION}
RUN pip install --no-cache-dir .

# Switch to non-root user
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ testpaths = ["tests"]
version_scheme = "guess-next-dev"
local_scheme = "no-local-version"
tag_regex = "^v(?P<version>[0-9]+\\.[0-9]+\\.[0-9]+(-alpha|-beta|-rc[0-9]+)?)$"
fallback_version = "0.0.0.dev0"
2 changes: 1 addition & 1 deletion src/meshcore_proxy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""MeshCore Proxy - TCP proxy for MeshCore companion radios."""

from importlib.metadata import version, PackageNotFoundError
from importlib.metadata import PackageNotFoundError, version

try:
__version__ = version("meshcore-proxy")
Expand Down
Loading