.gitlab-ci.yml 4.41 KB
Newer Older
Rye Mutt's avatar
Rye Mutt committed
1 2 3 4 5
stages:
  - build
  - deploy

variables:
6
  VIEWER_USE_CRASHPAD: "TRUE"
7
  VIEWER_CRASHPAD_URL: $SENTRY_DSN
Rye Mutt's avatar
Rye Mutt committed
8

9
.win_build: &win_build
10 11 12 13 14 15 16
  stage: build
  tags:
    - autobuild
    - windows
  before_script:
    - pipenv install
  script:
17 18 19 20
    - If ($env:VIEWER_CHANNEL_TYPE -eq 'Project') 
      { 
          $env:VIEWER_CHANNEL_CODENAME = $env:CI_COMMIT_REF_NAME[8..100] -join '' 
      }
21
    - pipenv run autobuild configure -c ReleaseOS -- -DUSE_FMODSTUDIO=ON -DUSE_NVAPI=ON -DUSE_LTO=ON -DVS_DISABLE_FATAL_WARNINGS=ON
22
    - pipenv run autobuild build -c ReleaseOS --no-configure
23
    - If ($env:VIEWER_USE_CRASHPAD -eq 'TRUE') {
24
    - Push-Location .\build-vc-*\newview\Release\
25
    - sentry-cli upload-dif --include-sources alchemy-bin.exe alchemy-bin.pdb crashpad_handler.exe crashpad_handler.pdb openjpeg.pdb openjpeg.dll fmod.dll libcrypto-1_1.dll libcrypto-1_1.pdb libssl-1_1.dll libssl-1_1.pdb libcrypto-1_1-x64.dll libcrypto-1_1-x64.pdb libssl-1_1-x64.dll libssl-1_1-x64.pdb vcruntime140.dll msvcp140.dll nghttp2.dll glod.dll
26
    - Pop-Location }
27 28
  artifacts:
    name: "$env:CI_COMMIT_REF_NAME-$env:CI_COMMIT_SHORT_SHA"
29
    expire_in: 2 week
30
    paths:
31 32 33 34
      - build-vc-*/newview/Release/build_data.json
      - build-vc-*/newview/Release/alchemy-bin.pdb
      - build-vc-*/newview/Release/Alchemy_*_Setup.exe
      
35 36 37 38 39 40 41 42 43 44 45 46
.beta_rules: &beta_rules
  only:
    - /^.*-beta$/
  except:
    - branches

.release_rules: &release_rules
  only:
    - /^.*-release$/
  except:
    - branches

47 48
build:master:windows32:
  <<: *win_build
49
  interruptible: true
50 51 52 53
  variables:
    AUTOBUILD_ADDRSIZE: 32
    VIEWER_CHANNEL_TYPE: Test
    VIEWER_USE_CRASHPAD: "FALSE"
Rye Mutt's avatar
Rye Mutt committed
54 55
  only:
    - schedules
Rye Mutt's avatar
Rye Mutt committed
56
    - web
Rye Mutt's avatar
Rye Mutt committed
57

58
build:master:windows64:
59
  <<: *win_build
60
  interruptible: true
61 62 63 64
  variables:
    AUTOBUILD_ADDRSIZE: 64
    VIEWER_CHANNEL_TYPE: Test
    VIEWER_USE_CRASHPAD: "FALSE"
Rye Mutt's avatar
Rye Mutt committed
65 66
  only:
    - schedules
Rye Mutt's avatar
Rye Mutt committed
67
    - web
68

Rye Mutt's avatar
Rye Mutt committed
69
build:project:windows32:
70
  <<: *win_build
71
  interruptible: true
72 73 74
  variables:
    AUTOBUILD_ADDRSIZE: 32
    VIEWER_CHANNEL_TYPE: Project
Rye Mutt's avatar
Rye Mutt committed
75
  only:
Rye Mutt's avatar
Rye Mutt committed
76
    - /^project-.*$/
77

Rye Mutt's avatar
Rye Mutt committed
78
build:project:windows64:
79
  <<: *win_build
80
  interruptible: true
81 82 83
  variables:
    AUTOBUILD_ADDRSIZE: 64
    VIEWER_CHANNEL_TYPE: Project
Rye Mutt's avatar
Rye Mutt committed
84
  only:
Rye Mutt's avatar
Rye Mutt committed
85
    - /^project-.*$/
86 87

build:beta:windows32:
88 89 90 91
  <<: *win_build
  variables:
    AUTOBUILD_ADDRSIZE: 32
    VIEWER_CHANNEL_TYPE: Beta
92 93
  <<: *beta_rules

94
build:beta:windows64:
95 96 97 98
  <<: *win_build
  variables:
    AUTOBUILD_ADDRSIZE: 64
    VIEWER_CHANNEL_TYPE: Beta
99
  <<: *beta_rules
Rye Mutt's avatar
Rye Mutt committed
100 101

build:release:windows32:
102 103
  <<: *win_build
  variables:
104
    AUTOBUILD_ADDRSIZE: 32
105
    VIEWER_CHANNEL_TYPE: Release
106
  <<: *release_rules
Rye Mutt's avatar
Rye Mutt committed
107

Rye Mutt's avatar
Rye Mutt committed
108
build:release:windows64:
109 110 111 112
  <<: *win_build
  variables:
    AUTOBUILD_ADDRSIZE: 64
    VIEWER_CHANNEL_TYPE: Release
113
  <<: *release_rules
Rye Mutt's avatar
Rye Mutt committed
114

115
.deploy_template: &deploy_template
Rye Mutt's avatar
Rye Mutt committed
116
  stage: deploy
Rye Mutt's avatar
Rye Mutt committed
117 118 119 120
  tags:
    - autobuild
    - windows
  script:
Rye Mutt's avatar
Rye Mutt committed
121
    - $BuildData = Get-Content .\build-vc-64\newview\Release\build_data.json | ConvertFrom-Json
122 123 124 125 126 127 128 129 130 131
    - $BuildChannelVersion = $BuildData."Channel" + ' ' + $BuildData."Version"
    - $UploadDestViewerDir = $BuildChannelVersion.ToLower().Replace(" ", "/")
    - $UploadDestURL = "https://pkg.alchemyviewer.org/repository/viewer/${UploadDestViewerDir}"

    - $UploadParams = @{ UseBasicParsing = $true;
      Method = "PUT";
      Headers = @{
        ContentType = "application/x-executable";
        Authorization = "Basic $([System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("$env:AUTOBUILD_HTTP_USER`:$env:AUTOBUILD_HTTP_PASS")))"; };
      Verbose = $true; };
Rye Mutt's avatar
Rye Mutt committed
132

Rye Mutt's avatar
Rye Mutt committed
133 134
    - Push-Location .\build-vc-32\newview\Release\
    - $FileNameWin32 = Get-ChildItem -Path . -Name -Include Alchemy_*_Setup.exe
135
    - Invoke-WebRequest @UploadParams -InFile .\$FileNameWin32 -Uri "${UploadDestURL}/${FileNameWin32}"
Rye Mutt's avatar
Rye Mutt committed
136
    - Pop-Location
Rye Mutt's avatar
Rye Mutt committed
137

Rye Mutt's avatar
Rye Mutt committed
138 139
    - Push-Location .\build-vc-64\newview\Release\
    - $FileNameWin64 = Get-ChildItem -Path . -Name -Include Alchemy_*_Setup.exe
140
    - Invoke-WebRequest @UploadParams -InFile .\$FileNameWin64 -Uri "${UploadDestURL}/${FileNameWin64}"
Rye Mutt's avatar
Rye Mutt committed
141
    - Pop-Location
142 143 144 145
    
    - sentry-cli releases new $BuildChannelVersion
    - sentry-cli releases set-commits --auto $BuildChannelVersion
    - sentry-cli releases finalize $BuildChannelVersion
Rye Mutt's avatar
Rye Mutt committed
146
  when: manual
147 148 149 150 151

deploy_project:
  <<: *deploy_template
  environment:
    name: qa
Rye Mutt's avatar
Rye Mutt committed
152
  only:
Rye Mutt's avatar
Rye Mutt committed
153
    - /^project-.*$/
154 155 156 157 158 159 160 161 162 163 164 165

deploy_beta:
  <<: *deploy_template
  environment:
    name: staging
  <<: *beta_rules

deploy_release:
  <<: *deploy_template
  environment:
    name: production
  <<: *release_rules