-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
102 lines (97 loc) · 2.74 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
stages:
- generate
- build
- release
generate_linux:
stage: generate
image: registry.gitlab.com/clecherbauer/docker-images/python:3.8-debian-bullseye
script:
- export PYTHONPATH=$PWD/.pydeps
- export PATH=$PWD/.pydeps/bin:$PATH
- apt update
- apt install zip -y
- source ./build.sh
- build_linux
- echo LINUX_JOB_ID=$CI_JOB_ID >> linux.env
artifacts:
paths:
- docker-hosts.linux64.zip
reports:
dotenv: linux.env
generate_macos:
stage: generate
image: registry.gitlab.com/clecherbauer/docker-images/python:3.8-debian-bullseye
script:
- export PYTHONPATH=$PWD/.pydeps
- export PATH=$PWD/.pydeps/bin:$PATH
- apt update
- apt install zip -y
- source ./build.sh
- build_macos
- echo MACOS_JOB_ID=$CI_JOB_ID >> macos.env
artifacts:
paths:
- docker-hosts.macOS64.zip
reports:
dotenv: macos.env
generate_windows:
stage: generate
image:
name: registry.gitlab.com/clecherbauer/docker-images/pyinstaller-windows:python-3.8-ubuntu-20.04
entrypoint: [""]
script:
- apt update
- apt install zip -y
- export REQUIREMENTS_TXT=requirements_windows.txt
- pyinstaller-windows() { /usr/local/bin/entrypoint.sh "$@"; }
- export -f pyinstaller-windows
- source ./build.sh
- build_windows
- echo WINDOWS_JOB_ID=$CI_JOB_ID >> windows.env
artifacts:
paths:
- docker-hosts.win64.zip
reports:
dotenv: windows.env
build:
stage: build
image: docker:git
services:
- name: docker:dind
before_script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
script:
- if [[ ! -z "$CI_COMMIT_TAG" ]]; then export IMAGE_TAG="$CI_COMMIT_TAG"; else export IMAGE_TAG="$CI_COMMIT_SHORT_SHA"; fi
- export IMAGE_NAME=$CI_REGISTRY/$CI_PROJECT_PATH:$IMAGE_TAG
- touch .env
- docker build -t $IMAGE_NAME .
- docker push $IMAGE_NAME
needs:
- job: generate_linux
artifacts: true
release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- echo 'running release_job'
needs:
- job: generate_linux
artifacts: true
- job: generate_macos
artifacts: true
- job: generate_windows
artifacts: true
release:
name: 'Release $CI_COMMIT_TAG'
description: '$CI_COMMIT_TAG'
tag_name: '$CI_COMMIT_TAG'
assets:
links:
- name: 'Linux executable'
url: '$CI_PROJECT_URL/-/jobs/${LINUX_JOB_ID}/artifacts/raw/docker-hosts.linux64.zip'
- name: 'MacOS executable'
url: '$CI_PROJECT_URL/-/jobs/${MACOS_JOB_ID}/artifacts/raw/docker-hosts.macOS64.zip'
- name: 'Windows executable'
url: '$CI_PROJECT_URL/-/jobs/${WINDOWS_JOB_ID}/artifacts/raw/docker-hosts.win64.zip'
only:
- tags