Skip to content

Commit

Permalink
fix: package versioning, uncomment release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgrittner committed Aug 19, 2024
1 parent 6ce1b56 commit b1b7006
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 24 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ jobs:
contents: read
steps:
- uses: actions/[email protected]
# - name: Get the version from the github tag ref
# id: get_version
# run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Set up Python
uses: actions/setup-python@v2
with:
Expand All @@ -23,10 +20,8 @@ jobs:
with:
virtualenvs-create: true
virtualenvs-in-project: true
# - name: Update version (kept at 0.0.0) in pyproject.toml and build
# run: |
# poetry version ${{ github.ref_name }}
# poetry build
- name: Build package
run: poetry build
- name: Build package
run: poetry build
- name: Publish the package with poetry
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ on:
- main
# - release
jobs:
# setup-and-test:
# uses: ./.github/workflows/unit-test.yml
# with:
# os: ubuntu-latest
# secrets: inherit
setup-and-test:
uses: ./.github/workflows/unit-test.yml
with:
os: ubuntu-latest
secrets: inherit
publish-python-package:
if: github.repository == 'Admyral-Security/admyral'
# needs:
# - setup-and-test
needs:
- setup-and-test
uses: ./.github/workflows/publish-to-pypi.yml
# Set permissions for trusted publishing.
permissions:
id-token: write
contents: read
secrets: inherit
# publish-docker-images:
# if: github.repository == 'Admyral-Security/admyral'
# needs:
# - setup-and-test
# uses: ./.github/workflows/publish-docker-hub.yml
# secrets: inherit
publish-docker-images:
if: github.repository == 'Admyral-Security/admyral'
needs:
- setup-and-test
uses: ./.github/workflows/publish-docker-hub.yml
secrets: inherit
5 changes: 3 additions & 2 deletions admyral/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
__version__ = "0.1.0"

from importlib.metadata import version
from admyral.logger import setup_root_logger

__version__ = version(__name__)

setup_root_logger()
22 changes: 21 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,17 @@ exclude = [
"examples",
"tests",
"img",
"docs"
"docs",
"web",
"docker",
"scripts",
"deploy",
]
include = [
"admyral",
"*.txt",
"*.md",
"deploy/docker-compose"
]

[tool.poetry.scripts]
Expand Down Expand Up @@ -45,6 +55,7 @@ ruff = "^0.5.5"
multipledispatch = "^1.0.0"
asyncpg = "^0.29.0"
psycopg2-binary = "^2.9.9"
setuptools-scm = "^8.1.0"

[tool.poetry.group.dev.dependencies]
pytest = "^8.2.2"
Expand All @@ -56,3 +67,6 @@ build-backend = "poetry.core.masonry.api"

[tool.pytest.ini_options]
asyncio_mode = "auto"

[tool.setuptools_scm]
version_scheme = "guess-next-dev"

0 comments on commit b1b7006

Please sign in to comment.