-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
107 lines (96 loc) · 3.02 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
103
104
105
stages:
- build
- release
- deploy
include:
- project: 'ci_cd/tools'
ref: '1.2.1'
file:
- '/zip.yaml'
- '/download_upload.yaml'
- project: 'ci_cd/release'
ref: '1.0.1'
file: /release.yaml
workflow:
rules:
- if: $CI_COMMIT_TAG
generate_packages:
stage: build
script:
# Note: Script requires to run gitlab-runner in "shell" mode using "cmd" as the shell (not "powershell")
- start "" /wait "C:\Program Files\Altium\AD21\X2.EXE" -RScriptingSystem:RunScript(ProjectName="%cd%\%CI_PROJECT_NAME%.PrjPcb"^|ProcName="GenerateOutputFiles")
- rmdir /S /Q History
after_script:
- taskkill /im x2.exe
# - taskkill /f /im x2.exe
tags: ["altium", "windows"]
artifacts:
untracked: true
expire_in: 1 hrs
changelog_job:
stage: release
extends: .auto-changelog
script:
- |
if $(git describe --abbrev=0 --tags HEAD~1); then
auto-changelog --starting-commit $(git rev-list $(git show-ref --hash $(git describe --abbrev=0 --tags HEAD~1))..HEAD | tail -1) --tag-pattern "(.\d*)" --stdout >> RELEASENOTES.md
else
auto-changelog --tag-pattern "(.\d*)" --stdout >> RELEASENOTES.md
fi
release_job:
stage: release
extends: .release
needs:
- job: generate_packages
artifacts: false
- job: changelog_job
artifacts: true
release:
name: 'Release $CI_COMMIT_TAG'
tag_name: '$CI_COMMIT_TAG'
ref: '$CI_COMMIT_TAG'
description: './RELEASENOTES.md'
process_artifacts:
stage: deploy
image: mcr.microsoft.com/powershell:7.2-alpine-3.13
needs:
- job: generate_packages
artifacts: true
script:
- pwsh -command "& { . .\deploy.ps1; Manufacturing }"
- pwsh -command "& { . .\deploy.ps1; Get-ArchiveName }"
artifacts:
expire_in: 1 hrs
untracked: true
reports:
dotenv: variables.env
tags:
- docker
zip_job:
stage: deploy
extends: .zip
needs:
- job: process_artifacts
artifacts: true
before_script:
- rm -f ./variables.env
variables:
GIT_STRATEGY: none
KS2_ARCHIVE_DIR: "./*"
KS2_ARCHIVE_FILE: "$ARCHIVE_NAME"
upload_job:
stage: deploy
extends: .confpoint
needs:
- job: zip_job
artifacts: true
- job: process_artifacts
artifacts: true
variables:
KS2_UPLOAD_FILE: $KS2_ARCHIVE_FILE
KS2_UPLOAD_DOMEN: '/sites/SPBTeam'
KS2_PREUPLOAD_PATH: "Shared Documents/Projects/$PROJECT_TITLE"
KS2_UPLOAD_PATH: "$KS2_PREUPLOAD_PATH/HW"
script:
- confpoint-uploader -u "$KS2_SHAREPOINT_USER" -p "$KS2_SHAREPOINT_PASS" -f "./README.md" -g "$KS2_UPLOAD_DOMEN" -r "$KS2_PREUPLOAD_PATH" -l "https://ks2corpinc.sharepoint.com"
- confpoint-uploader -u "$KS2_SHAREPOINT_USER" -p "$KS2_SHAREPOINT_PASS" -f "$KS2_UPLOAD_FILE" -g "$KS2_UPLOAD_DOMEN" -r "$KS2_UPLOAD_PATH" -l "https://ks2corpinc.sharepoint.com" --timeout "$KS2_SHAREPOINT_TIMEOUT"