.gitlab-ci.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. image: docker:20.10.22
  2. variables:
  3. DOCKER_DRIVER: overlay2
  4. DOCKER_TLS_CERTDIR: "/certs"
  5. DOCKER_HOST: tcp://docker:2376
  6. # Where to publish this build's tagged working container.
  7. DOCKER_SHA: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
  8. DOCKER_BRANCH: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
  9. DOCKER_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
  10. DOCKER_LATEST: $CI_REGISTRY_IMAGE:latest
  11. services:
  12. - docker:20.10.22-dind
  13. stages:
  14. - build
  15. - test
  16. - release
  17. before_script:
  18. - docker info
  19. - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
  20. build-upload:
  21. image: python:3.11
  22. stage: build
  23. before_script:
  24. - python -V
  25. - echo "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi"
  26. script:
  27. - pip install build twine flit
  28. - FLIT_INDEX_URL=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi flit build
  29. - TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/*
  30. only:
  31. - tags
  32. .build-upload-pypi:
  33. image: python:3.11
  34. stage: build
  35. before_script:
  36. - python -V
  37. - echo "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi"
  38. script:
  39. - pip install build twine flit
  40. - flit build
  41. - python -m twine upload dist/*
  42. only:
  43. - tags
  44. build-windows-exe:
  45. image: tobix/pywine:3.11 # Use this image instead of the custom one. It's maintained and easier. registry.rys.one/arrys/pyinstaller
  46. stage: build
  47. before_script:
  48. - echo "Building windows executable"
  49. script:
  50. - xvfb-run sh -c "wine pip install --no-warn-script-location -r requirements.py; wineserver -w"
  51. # - pyinstaller graph_exploring_tool/__main__.py --onefile --add-data data:data --collect-all graph-exploring-tool --windowed --noconfirm
  52. - xvfb-run sh -c "wine pyinstaller graph_exploring_tool/__main__.py --onefile; wineserver -w"
  53. - cp -r data/* ./dist/data/
  54. - zip files dist
  55. - ls -la dist
  56. # only:
  57. # - tags
  58. artifacts:
  59. name: "graph-exploring-tool-%CI_TAG.zip" # % because of windoze https://docs.gitlab.com/ee/ci/jobs/job_artifacts.html#with-a-windows-runner-or-shell-executor
  60. paths:
  61. - ./dist/graph-exploring-tool.zip