Skip to content
Snippets Groups Projects
.gitlab-ci.yml 5.93 KiB
Newer Older
Rye Mutt's avatar
Rye Mutt committed
stages:
  - build
Rye Mutt's avatar
Rye Mutt committed

default:
  interruptible: true

Rye Mutt's avatar
Rye Mutt committed
variables:
  VIEWER_USE_CRASHPAD: "FALSE"
Rye Mutt's avatar
Rye Mutt committed
  VIEWER_CRASHPAD_URL: $SENTRY_DSN

.win_build: &win_build
  stage: build
  tags:
    - autobuild
    - windows
  before_script:
    - pipenv install
  script:
        pipenv run autobuild configure -c ReleaseOS -- -DUSE_FMODSTUDIO=ON -DUSE_NVAPI=ON -DUSE_LTO=ON -DVS_DISABLE_FATAL_WARNINGS=ON
        pipenv run autobuild build -c ReleaseOS --no-configure
  artifacts:
    name: "$env:CI_COMMIT_REF_NAME-$env:CI_COMMIT_SHORT_SHA"
    expire_in: 2 week
    paths:
      - build-vc-*/newview/Release/build_data.json
      - build-vc-*/newview/Release/alchemy-bin.exe
      - build-vc-*/newview/Release/*.pdb
      - build-vc-*/newview/Release/*.dll
      - build-vc-*/newview/Release/Alchemy_*_Setup.exe
Rye Mutt's avatar
Rye Mutt committed

.lnx_build: &lnx_build
Rye Mutt's avatar
Rye Mutt committed
  stage: build
Rye Mutt's avatar
Rye Mutt committed
  image: r.alchemyviewer.org/alchemy/infrastructure/debian-build-image:latest
Rye Mutt's avatar
Rye Mutt committed
  tags:
Rye Mutt's avatar
Rye Mutt committed
    - linux
    - docker
Rye Mutt's avatar
Rye Mutt committed
  script:
Rye Mutt's avatar
Rye Mutt committed
        autobuild configure -c ReleaseOS -- -DUSE_FMODSTUDIO=ON -DUSE_NVAPI=ON -DUSE_LTO=ON -DUNIX_DISABLE_FATAL_WARNINGS=ON
Rye Mutt's avatar
Rye Mutt committed
        autobuild build -c ReleaseOS --no-configure
Rye Mutt's avatar
Rye Mutt committed
  artifacts:
    name: "$env:CI_COMMIT_REF_NAME-$env:CI_COMMIT_SHORT_SHA"
    expire_in: 2 week
    paths:
      - build-linux-*/build_data.json
      - build-linux-*/newview/Alchemy_*.tar.bz2
Rye Mutt's avatar
Rye Mutt committed

.master_rules: &master_rules
  only:
    variables:
      - $BUILD_CHANNEL =~ /Test/


.project_rules: &project_rules
  only:
    variables:
      - $BUILD_CHANNEL =~ /Project/

.beta_rules: &beta_rules
  except:
    - branches

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

Rye Mutt's avatar
Rye Mutt committed
build:master:linux64:
  <<: *lnx_build
Rye Mutt's avatar
Rye Mutt committed
  variables:
    AUTOBUILD_ADDRSIZE: 64
    VIEWER_CHANNEL_TYPE: Test
    VIEWER_USE_CRASHPAD: "FALSE"
  <<: *master_rules

build:master:windows32:
  <<: *win_build
  variables:
    AUTOBUILD_ADDRSIZE: 32
    VIEWER_CHANNEL_TYPE: Test
    VIEWER_USE_CRASHPAD: "FALSE"
  <<: *master_rules

build:master:windows64:
  <<: *win_build
  variables:
    AUTOBUILD_ADDRSIZE: 64
    VIEWER_CHANNEL_TYPE: Test
    VIEWER_USE_CRASHPAD: "FALSE"
  <<: *master_rules

build:project:linux64:
  <<: *lnx_build
  variables:
    AUTOBUILD_ADDRSIZE: 64
    VIEWER_CHANNEL_TYPE: Project
  <<: *project_rules

build:project:windows32:
  <<: *win_build
  variables:
    AUTOBUILD_ADDRSIZE: 32
    VIEWER_CHANNEL_TYPE: Project
  <<: *project_rules

build:project:windows64:
  <<: *win_build
  variables:
    AUTOBUILD_ADDRSIZE: 64
    VIEWER_CHANNEL_TYPE: Project
  <<: *project_rules

build:beta:linux64:
  <<: *lnx_build
  variables:
    AUTOBUILD_ADDRSIZE: 64
    VIEWER_CHANNEL_TYPE: Beta
  <<: *beta_rules

build:beta:windows32:
  <<: *win_build
  variables:
    AUTOBUILD_ADDRSIZE: 32
    VIEWER_CHANNEL_TYPE: Beta
  <<: *beta_rules

build:beta:windows64:
  <<: *win_build
  variables:
    AUTOBUILD_ADDRSIZE: 64
    VIEWER_CHANNEL_TYPE: Beta
  <<: *beta_rules

build:release:linux64:
  <<: *lnx_build
  variables:
    AUTOBUILD_ADDRSIZE: 64
    VIEWER_CHANNEL_TYPE: Release
  <<: *release_rules

build:release:windows32:
  <<: *win_build
  variables:
    AUTOBUILD_ADDRSIZE: 32
    VIEWER_CHANNEL_TYPE: Release
  <<: *release_rules

build:release:windows64:
  <<: *win_build
  variables:
    AUTOBUILD_ADDRSIZE: 64
    VIEWER_CHANNEL_TYPE: Release
  <<: *release_rules
.deploy_template: &deploy_template
  stage: deploy
  tags:
    - autobuild
    - windows
  when: manual
  allow_failure: false
  script:
    - |
        $BuildData = Get-Content .\build-vc-64\newview\Release\build_data.json | ConvertFrom-Json
        $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; };

        Push-Location .\build-vc-32\newview\Release\
          $FileNameWin32 = Get-ChildItem -Path . -Name -Include Alchemy_*_Setup.exe
          Invoke-WebRequest @UploadParams -InFile .\$FileNameWin32 -Uri "${UploadDestURL}/${FileNameWin32}"
          If ($env:VIEWER_USE_CRASHPAD -eq 'TRUE') 
          {
            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
          }
        Pop-Location

        Push-Location .\build-vc-64\newview\Release\
          $FileNameWin64 = Get-ChildItem -Path . -Name -Include Alchemy_*_Setup.exe
          Invoke-WebRequest @UploadParams -InFile .\$FileNameWin64 -Uri "${UploadDestURL}/${FileNameWin64}"

          If ($env:VIEWER_USE_CRASHPAD -eq 'TRUE') 
          {
            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
          }
        Pop-Location
        sentry-cli releases new $BuildChannelVersion
        sentry-cli releases set-commits --auto $BuildChannelVersion
        sentry-cli releases finalize $BuildChannelVersion

deploy_project:
  <<: *deploy_template
  <<: *project_rules

deploy_beta:
  <<: *deploy_template
  <<: *beta_rules

deploy_release:
  <<: *deploy_template
  <<: *release_rules