diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 648c046..2395cbf 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -21,5 +21,5 @@ RUN apt-get update && \ ENV LANG en_US.UTF-8 ENV LC_ALL en_US.UTF-8 -# Install python packages +# Install needed python packages RUN pip3 install conan sphinx_rtd_theme breathe --break-system-packages \ No newline at end of file diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index fa235ff..39b4ce6 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -2,9 +2,8 @@ name: Conan Package on: push: - branches: [ main ] - tags: [ "v*" ] # Nur Tags, die mit v beginnen (z.B. v1.2.3) - pull_request: + tags: [ "v*" ] + workflow_dispatch: jobs: build-and-publish: @@ -19,9 +18,8 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 # wichtig, damit Tags verfügbar sind + fetch-depth: 0 - # Version aus Git-Tag ableiten - name: Extract version from tag id: vars run: | @@ -45,7 +43,10 @@ jobs: - name: Create Conan package run: | - conan create . --version=${{ steps.vars.outputs.version }} --user=${{ github.actor }} --channel=stable + conan profile detect --force + conan create . --user=${{ github.repository_owner }} --channel=stable + env: + CONAN_REF_VERSION: ${{ steps.vars.outputs.version }} - name: Upload Conan package run: | diff --git a/conanfile.py b/conanfile.py index 0dc019d..f9193a9 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,10 +1,11 @@ +import os from conan import ConanFile from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps class EmbeddedLibRecipe(ConanFile): name = "embeddedlib" - version = "0.1.0" + version = os.getenv("CONAN_REF_VERSION", "0.0.0") package_type = "library" # Optional metadata