-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
85 lines (79 loc) · 2.11 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
85 lines (79 loc) · 2.11 KB
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
# SreeBase GitLab CI/CD Pipeline
# ------------------------------
# Automates testing, documentation generation (GitLab Pages),
# and compiles CLI executables (Windows & macOS) upon tagging a release.
stages:
- test
- pages
- build-installers
- release
# 1. Run the test suite on every commit
test_engine:
stage: test
image: python:3.11-slim
script:
- pip install pytest
- pytest tests/ -v
rules:
- if: $CI_PIPELINE_SOURCE == "push"
# 2. Host the documentation via GitLab Pages (Triggers on main branch)
pages:
stage: pages
image: python:3.11-slim
script:
- pip install mkdocs-material
- mkdocs build -d public
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_BRANCH == "main"
# 3. Build Windows CLI executable (Requires a Shared Windows Runner)
build_windows_cli:
stage: build-installers
tags:
- saas-windows-medium-amd64
script:
- pip install pyinstaller
- python build_installer.py
artifacts:
paths:
- dist/sreebase-cli.exe
expire_in: 1 week
rules:
- if: $CI_COMMIT_TAG
# 4. Build macOS CLI executable (Requires a Shared macOS Runner)
build_macos_cli:
stage: build-installers
tags:
- saas-macos-medium-m1
script:
- pip install pyinstaller
- python build_installer.py
artifacts:
paths:
- dist/sreebase-cli
expire_in: 1 week
rules:
- if: $CI_COMMIT_TAG
# 5. Create a GitLab Release and attach the binaries
release_binaries:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs:
- build_windows_cli
- build_macos_cli
script:
- echo "Publishing SreeBase CLI Release $CI_COMMIT_TAG"
release:
name: "Release $CI_COMMIT_TAG"
description: "Automated release of SreeBase $CI_COMMIT_TAG."
tag_name: $CI_COMMIT_TAG
assets:
links:
- name: 'sreebase-cli-windows.exe'
url: '${CI_PROJECT_URL}/-/jobs/${build_windows_cli_job_id}/artifacts/file/dist/sreebase-cli.exe'
- name: 'sreebase-cli-macos'
url: '${CI_PROJECT_URL}/-/jobs/${build_macos_cli_job_id}/artifacts/file/dist/sreebase-cli'
rules:
- if: $CI_COMMIT_TAG