New pipline for building image

This commit is contained in:
Mr Finchum 2025-01-14 21:13:41 +01:00
parent a737d09e7c
commit 5b75ad5bea
3 changed files with 21 additions and 8 deletions

View file

@ -1,10 +1,10 @@
---
include:
- local: .gitlab-ci/versioning/gitversion.yml
- local: .gitlab-ci/git/create_tag.yml
stages:
- build
- release
gitversion:
@ -12,8 +12,21 @@ gitversion:
stage: .pre
tags:
- gitlab-org-docker
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run this job when commits are pushed or merged to the default branch
# rules:
# - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run this job when commits are pushed or merged to the default branch
build:
stage: build
image: python:3.9.21
tags:
- gitlab-org-docker
needs:
- job: gitversion
artifacts: true
script:
- sed -i "s/###VERSION###/$GitVersion_SemVer/" src/optima35/__init__.py
- python3 -m pip install --upgrade pip build twine
- python3 -m build
create_tag:
extends: .git:create_tag
@ -21,7 +34,7 @@ create_tag:
tags:
- gitlab-org-docker
variables:
VERSION: v$GitVersion_SemVer
VERSION: $GitVersion_SemVer
TOKEN: $GITLAB_TOKEN
needs:
- job: gitversion

View file

@ -17,7 +17,7 @@ classifiers = [
]
[project.urls]
Homepage = "https://gitlab.com/CodeByMrFinchum/optima35"
Source = "https://gitlab.com/CodeByMrFinchum/optima35"
[project.scripts]
optima35 = "optima35.__main__:main"

View file

@ -1 +1 @@
__version__ = "0.6.4"
__version__ = ###VERSION###