-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
46 lines (43 loc) · 1.79 KB
/
.gitlab-ci.yml
File metadata and controls
46 lines (43 loc) · 1.79 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
stages:
- build
- release
variables:
VERSION: $CI_COMMIT_TAG
build-windows:
stage: build
tags:
- saas-windows-medium-amd64
rules:
- if: $CI_COMMIT_TAG =~ /^v.*/
script:
- cd desktop
- pip install -r requirements.txt
- pip install pyinstaller
- python build.py
- choco install innosetup -y
- $version = $env:CI_COMMIT_TAG -replace '^v', ''
- echo "Building installer for version $version"
- (Get-Content installer.iss) -replace '#define MyAppVersion ".*"', "#define MyAppVersion `"$version`"" | Set-Content installer.iss
- '& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" installer.iss'
artifacts:
paths:
- desktop/installer_output/PingDiff-Setup-*.exe
expire_in: 1 week
release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG =~ /^v.*/
needs:
- job: build-windows
artifacts: true
script:
- 'VERSION_NUM=$(echo $CI_COMMIT_TAG | sed "s/^v//")'
- 'echo "Creating release for $CI_COMMIT_TAG (version $VERSION_NUM)"'
- 'ls -la desktop/installer_output/'
- 'INSTALLER_FILE=$(ls desktop/installer_output/PingDiff-Setup-*.exe | head -1)'
- 'INSTALLER_NAME=$(basename "$INSTALLER_FILE")'
- 'echo "Found installer - $INSTALLER_NAME"'
- 'ASSET_URL="${CI_PROJECT_URL}/-/jobs/artifacts/${CI_COMMIT_TAG}/raw/desktop/installer_output/${INSTALLER_NAME}?job=build-windows"'
- 'DESCRIPTION="New release with Windows installer. Supported Games: Overwatch 2, Call of Duty, Valorant, Counter-Strike 2, Battlefield 6, Marvel Rivals, Fortnite, League of Legends, Apex Legends"'
- 'release-cli create --name "PingDiff $CI_COMMIT_TAG" --tag-name "$CI_COMMIT_TAG" --description "$DESCRIPTION" --assets-link "{\"name\":\"$INSTALLER_NAME\",\"url\":\"$ASSET_URL\"}"'