.gitlab-ci.yml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. - apt install -qy zip tree
  50. script:
  51. - xvfb-run sh -c "wine python.exe -m pip install --upgrade pip; wineserver -w"
  52. - xvfb-run sh -c "wine python.exe -m pip install --no-warn-script-location -r requirements.txt; wineserver -w"
  53. # - xvfb-run sh -c "wine pyinstaller graph_exploring_tool/__main__.py --onefile --add-data data:data --collect-all graph-exploring-tool --windowed --noconfirm; wineserver -w"
  54. # - xvfb-run sh -c "wine pyinstaller graph_exploring_tool/__main__.py --name get.exe --paths=graph_exploring_tool --noconfirm; wineserver -w"
  55. - xvfb-run sh -c "wine pyinstaller graph_exploring_tool/__main__.py --name get.exe --paths=graph_exploring_tool --windowed --noconfirm; wineserver -w"
  56. - ls -la dist
  57. - tree dist
  58. - mv dist/get.exe/* ./
  59. rules:
  60. - if: $CI_COMMIT_TAG
  61. - if: $CI_PIPELINE_SOURCE == "push" || $CI_COMMIT_BRANCH == "dev"
  62. when: manual
  63. allow_failure: true
  64. artifacts:
  65. name: "graph_exploring_tool%$CI_COMMIT_TAG"
  66. untracked: true
  67. paths:
  68. - data
  69. exclude:
  70. - build