From d40096a3a5387cc1da0b340f5b9921ed2a8d8d70 Mon Sep 17 00:00:00 2001 From: Byron Lathi Date: Thu, 6 Jun 2024 18:55:01 -0700 Subject: [PATCH 1/3] Only deploy on merges to master --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ce4666f..6d913dc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,8 +27,8 @@ deploy: stage: deploy rules: # only run on MRs to main - - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" + - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" # run on commits to main - - if: $CI_COMMIT_BRANCH == "main" + - if: $CI_COMMIT_BRANCH == "master" script: - TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${PACKAGE_PROJECT_ID}/packages/pypi dist/* From 2c3cd7f232bb4cfd5d03516b0046ac5b62cbf744 Mon Sep 17 00:00:00 2001 From: Byron Lathi Date: Thu, 6 Jun 2024 18:56:44 -0700 Subject: [PATCH 2/3] Source env each time --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6d913dc..f6824b6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,6 +21,7 @@ test: rules: - when: always script: + - source init_env.sh - echo "Haha no tests yet" deploy: @@ -31,4 +32,5 @@ deploy: # run on commits to main - if: $CI_COMMIT_BRANCH == "master" script: + - source init_env.sh - TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${PACKAGE_PROJECT_ID}/packages/pypi dist/* From dc8f29c9c1af03415b1726e43371365c7b84d2bb Mon Sep 17 00:00:00 2001 From: Byron Lathi Date: Thu, 6 Jun 2024 19:01:21 -0700 Subject: [PATCH 3/3] Change verison automatically --- pyproject.toml | 4 +++- src/rtl_manifest/__init__.py | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7470434..f5c434b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,9 @@ name = "rtl-manifest" # REQUIRED, is the only field that cannot be marked as dy # # For a discussion on single-sourcing the version, see # https://packaging.python.org/guides/single-sourcing-package-version/ -version = "0.0.2" # REQUIRED, although can be dynamic + +dynamic = ["version"] +# version = "0.0.3" # REQUIRED, although can be dynamic # This is a one-line description or tagline of what your project does. This # corresponds to the "Summary" metadata field: diff --git a/src/rtl_manifest/__init__.py b/src/rtl_manifest/__init__.py index 591d4e9..274ed5a 100644 --- a/src/rtl_manifest/__init__.py +++ b/src/rtl_manifest/__init__.py @@ -1,4 +1,9 @@ from .rtl_manifest import rtl_manifest_main +VERSION_BASE = "0.0.3" + +import datetime +__version__ = f"{VERSION_BASE}.{datetime.datetime.now().strftime('%Y.%m.%d.%H%M')}" + def main(): rtl_manifest_main() \ No newline at end of file