Skip to content
Snippets Groups Projects
.gitlab-ci.yml 10.9 KiB
Newer Older
Rye Mutt's avatar
Rye Mutt committed
stages:
  - build
Rye Mutt's avatar
Rye Mutt committed
  - upload
 
default:
  interruptible: true
Rye Mutt's avatar
Rye Mutt committed
  timeout: 4h
Rye Mutt's avatar
Rye Mutt committed
variables:
  AUTOBUILD_BUILD_ID: $CI_PIPELINE_ID
Rye Mutt's avatar
Rye Mutt committed
  AUTOBUILD_INSTALLABLE_CACHE: "$CI_PROJECT_DIR/.cache/autobuild"
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
Rye Mutt's avatar
Rye Mutt committed

Rye Mutt's avatar
Rye Mutt committed
.win_build:
  stage: build
  tags:
    - autobuild
    - windows
Rye Mutt's avatar
Rye Mutt committed
  cache:
    key:
      files:
        - autobuild.xml
      prefix: ${CI_JOB_NAME}
    paths:
      - .cache/autobuild
      - .cache/pip
      - .venv/
    when: 'always'
  before_script:
    - virtualenv -p C:\Python39\python.exe .venv
Rye Mutt's avatar
Rye Mutt committed
    - .\.venv\Scripts\activate.ps1
    - pip3 install --upgrade autobuild -i https://ci-job-token:${CI_JOB_TOKEN}@git.alchemyviewer.org/api/v4/projects/54/packages/pypi/simple --extra-index-url https://pypi.org/simple
    - autobuild configure -c ReleaseOS -- -DUSE_FMODSTUDIO=ON -DUSE_NVAPI=ON -DUSE_LTO=ON -DDISABLE_FATAL_WARNINGS=ON -DREVISION_FROM_VCS=FALSE
    - autobuild build -c ReleaseOS --no-configure
    - autobuild graph -c ReleaseOS --graph-file alchemy-windows${AUTOBUILD_ADDRSIZE}-dependencies.svg
  artifacts:
    name: "$env:CI_COMMIT_REF_NAME-$env:CI_COMMIT_SHORT_SHA"
Rye Mutt's avatar
Rye Mutt committed
    expire_in: 1 week
    paths:
      - build-vc-*/newview/Release/build_data.json
      - build-vc-*/newview/Release/alchemy-bin.exe
      - build-vc-*/newview/Release/alchemy-bin.pdb
      - build-vc-*/packages/lib/release/alut*.dll
      - build-vc-*/packages/lib/release/epoxy-*.dll
      - build-vc-*/packages/lib/release/glod*.dll
      - build-vc-*/packages/lib/release/libapr*.dll
      - build-vc-*/packages/lib/release/libexpat*.dll
      - build-vc-*/packages/lib/release/libhunspell*.dll
      - build-vc-*/packages/lib/release/libogg*.dll
      - build-vc-*/packages/lib/release/libvorbis*.dll
      - build-vc-*/packages/lib/release/OpenAL32*.dll
      - build-vc-*/packages/lib/release/openjp2*.dll
      - build-vc-*/packages/lib/release/sentry.dll
      - build-vc-*/packages/lib/release/xmlrpc-epi*.dll
      - build-vc-*/packages/lib/release/*.pdb
      - build-vc-*/newview/Release/Alchemy_*_Setup.exe
      - alchemy-*-dependencies.svg
Rye Mutt's avatar
Rye Mutt committed
.mac_build:
  stage: build
  tags:
    - mac
Rye Mutt's avatar
Rye Mutt committed
    - bash
Rye Mutt's avatar
Rye Mutt committed
  cache:
    key:
      files:
        - autobuild.xml
      prefix: ${CI_JOB_NAME}
    paths:
      - .cache/autobuild
      - .cache/pip
      - .venv
    when: 'always'
  variables:
    USE_SENTRY: "TRUE"
Rye Mutt's avatar
Rye Mutt committed
  before_script:
    - virtualenv .venv -p python3
Rye Mutt's avatar
Rye Mutt committed
    - source .venv/bin/activate
    - pip3 install --upgrade autobuild dmgbuild -i https://ci-job-token:${CI_JOB_TOKEN}@git.alchemyviewer.org/api/v4/projects/54/packages/pypi/simple --extra-index-url https://pypi.org/simple
Rye Mutt's avatar
Rye Mutt committed
  script:
    - autobuild configure -c ReleaseOS -- -DUSE_FMODSTUDIO=ON -DUSE_NVAPI=ON -DUSE_LTO=ON -DDISABLE_FATAL_WARNINGS=ON -DREVISION_FROM_VCS=FALSE
    - autobuild build -c ReleaseOS --no-configure
    - autobuild graph -c ReleaseOS --graph-file alchemy-darwin${AUTOBUILD_ADDRSIZE}-dependencies.svg
Rye Mutt's avatar
Rye Mutt committed
  artifacts:
    name: "$env:CI_COMMIT_REF_NAME-$env:CI_COMMIT_SHORT_SHA"
    expire_in: 1 week
    paths:
      - build-darwin-*/build_data.json
      - build-darwin-*/packages/lib/release/libalut*.dylib
      - build-darwin-*/packages/lib/release/libapr*.dylib
      - build-darwin-*/packages/lib/release/libepoxy*.dylib
      - build-darwin-*/packages/lib/release/libGLOD*.dylib
      - build-darwin-*/packages/lib/release/libhunspell*.dylib
      - build-darwin-*/packages/lib/release/libndofdev*.dylib
      - build-darwin-*/packages/lib/release/libogg*.dylib
      - build-darwin-*/packages/lib/release/libopenal*.dylib
      - build-darwin-*/packages/lib/release/libvorbis*.dylib
      - build-darwin-*/packages/lib/release/libxmlrpc*.dylib
      - build-darwin-*/packages/lib/release/Sentry.framework
      - build-darwin-*/packages/lib/release/*.dSYM
Rye Mutt's avatar
Rye Mutt committed
      - build-darwin-*/newview/Alchemy_*.dmg
      - build-darwin-*/newview/Release/*.app/Contents/MacOS/*
      - build-darwin-*/newview/Release/*.dSYM
      - alchemy-*-dependencies.svg
Rye Mutt's avatar
Rye Mutt committed

Rye Mutt's avatar
Rye Mutt committed
.linux_build:
Rye Mutt's avatar
Rye Mutt committed
  stage: build
  image: r.alchemyviewer.org/alchemy/infrastructure/ubuntu-build-image:latest-llvm
Rye Mutt's avatar
Rye Mutt committed
  tags:
Rye Mutt's avatar
Rye Mutt committed
    - linux
    - docker
Rye Mutt's avatar
Rye Mutt committed
  cache:
    key:
      files:
        - autobuild.xml
      prefix: ${CI_JOB_NAME}
    paths:
      - .cache/autobuild
      - .cache/pip
      - .venv
    when: 'always'
  before_script:
    - virtualenv .venv -p python3
Rye Mutt's avatar
Rye Mutt committed
    - source .venv/bin/activate
    - pip3 install --upgrade autobuild -i https://ci-job-token:${CI_JOB_TOKEN}@git.alchemyviewer.org/api/v4/projects/54/packages/pypi/simple --extra-index-url https://pypi.org/simple
Rye Mutt's avatar
Rye Mutt committed
  script:
    - autobuild configure -c ReleaseOS -- -DUSE_FMODSTUDIO=ON -DUSE_NVAPI=ON -DUSE_LTO=ON -DDISABLE_FATAL_WARNINGS=ON -DREVISION_FROM_VCS=FALSE
    - autobuild build -c ReleaseOS --no-configure
    - autobuild graph -c ReleaseOS --graph-file alchemy-linuxs${AUTOBUILD_ADDRSIZE}-dependencies.svg
Rye Mutt's avatar
Rye Mutt committed
  artifacts:
    name: "$env:CI_COMMIT_REF_NAME-$env:CI_COMMIT_SHORT_SHA"
Rye Mutt's avatar
Rye Mutt committed
    expire_in: 1 week
Rye Mutt's avatar
Rye Mutt committed
    paths:
      - build-linux-*/build_data.json
      - build-linux-*/newview/Alchemy_*.tar.xz
      - alchemy-*-dependencies.svg
Rye Mutt's avatar
Rye Mutt committed

Rye Mutt's avatar
Rye Mutt committed
.win32_build:
  extends: .win_build
  variables:
    AUTOBUILD_ADDRSIZE: 32
  cache:
    key:
      prefix: windows32
Rye Mutt's avatar
Rye Mutt committed
.win64_build:
  extends: .win_build
Rye Mutt's avatar
Rye Mutt committed
  variables:
    AUTOBUILD_ADDRSIZE: 64
Rye Mutt's avatar
Rye Mutt committed
  cache:
    key:
      prefix: windows64
Rye Mutt's avatar
Rye Mutt committed
.mac64_build:
  extends: .mac_build
  variables:
    AUTOBUILD_ADDRSIZE: 64
  cache:
    key:
      prefix: darwin64

Rye Mutt's avatar
Rye Mutt committed
.linux32_build:
  extends: .linux_build
  variables:
    AUTOBUILD_ADDRSIZE: 32
  cache:
    key:
      prefix: linux32
Rye Mutt's avatar
Rye Mutt committed
.linux64_build:
  extends: .linux_build
  variables:
    AUTOBUILD_ADDRSIZE: 64
Rye Mutt's avatar
Rye Mutt committed
  cache:
    key:
      prefix: linux64

.master_rules:
  rules:
    - if: $BUILD_CHANNEL || $CI_COMMIT_TAG
      when: never
    - if: '$CI_PIPELINE_SOURCE == "web"'
    - if: '$CI_PIPELINE_SOURCE == "schedule"'
Rye Mutt's avatar
Rye Mutt committed
    #- if: '$CI_COMMIT_BRANCH == "master" && $CI_PIPELINE_SOURCE == "push"'
    #  when: delayed
    #  start_in: '12 hours'
Rye Mutt's avatar
Rye Mutt committed
  variables:
    VIEWER_CHANNEL_TYPE: Test
    VIEWER_USE_CRASHPAD: "FALSE"

Rye Mutt's avatar
Rye Mutt committed
.project_rules:
  rules:
    - if: '$BUILD_CHANNEL == "Project" && ($CI_PIPELINE_SOURCE == "web" || $CI_PIPELINE_SOURCE == "schedule")'
    - if: '$CI_COMMIT_TAG =~ /.*-project/'
  variables:
    VIEWER_CHANNEL_TYPE: Project

Rye Mutt's avatar
Rye Mutt committed
.beta_rules:
  rules:
    - if: '$BUILD_CHANNEL == "Beta" && ($CI_PIPELINE_SOURCE == "web" || $CI_PIPELINE_SOURCE == "schedule")'
    - if: '$CI_COMMIT_TAG =~ /.*-beta/'
  variables:
    VIEWER_CHANNEL_TYPE: Beta
Rye Mutt's avatar
Rye Mutt committed
.release_rules:
  rules:
    - if: '$BUILD_CHANNEL == "Release" && ($CI_PIPELINE_SOURCE == "web" || $CI_PIPELINE_SOURCE == "schedule")'
    - if: '$CI_COMMIT_TAG =~ /.*-release/'
  variables:
Rye Mutt's avatar
Rye Mutt committed
    VIEWER_CHANNEL_TYPE: Release

build:master:linux64:
  extends: 
    - .linux64_build 
    - .master_rules

Rye Mutt's avatar
Rye Mutt committed
build:master:mac64:
  extends: 
    - .mac64_build
    - .master_rules

Rye Mutt's avatar
Rye Mutt committed
.build:master:windows32:
  extends: 
    - .win32_build
    - .master_rules

build:master:windows64:
  extends: 
    - .win64_build
    - .master_rules

build:project:linux64:
  extends: 
    - .linux64_build
    - .project_rules

Rye Mutt's avatar
Rye Mutt committed
build:project:mac64:
  extends: 
    - .mac64_build
    - .project_rules

Rye Mutt's avatar
Rye Mutt committed
.build:project:windows64:
  extends: 
    - .win32_build
    - .project_rules

build:project:windows64:
  extends: 
    - .win64_build
    - .project_rules

build:beta:linux64:
Rye Mutt's avatar
Rye Mutt committed
  extends: 
    - .linux64_build
    - .beta_rules
Rye Mutt's avatar
Rye Mutt committed
build:beta:mac64:
  extends: 
    - .mac64_build
    - .beta_rules

Rye Mutt's avatar
Rye Mutt committed
.build:beta:windows32:
  extends: 
    - .win32_build
    - .beta_rules

build:beta:windows64:
Rye Mutt's avatar
Rye Mutt committed
  extends: 
    - .win64_build
    - .beta_rules

build:release:linux64:
Rye Mutt's avatar
Rye Mutt committed
  extends: 
    - .linux64_build
    - .release_rules
Rye Mutt's avatar
Rye Mutt committed
build:release:mac64:
  extends: 
    - .mac64_build
    - .release_rules

Rye Mutt's avatar
Rye Mutt committed
.build:release:windows32:
  extends: 
    - .win32_build
    - .release_rules

build:release:windows64:
Rye Mutt's avatar
Rye Mutt committed
  extends: 
    - .win64_build
    - .release_rules
Rye Mutt's avatar
Rye Mutt committed
.upload_template:
  stage: upload
    - powershell
    - m1
    - mac
  variables:
    USE_SENTRY: "TRUE"
        $BuildData = Get-Content ./build-vc-64/newview/Release/build_data.json | ConvertFrom-Json
        $BuildChannelVersion = $BuildData."Channel" + ' ' + $BuildData."Version"
        $PkgName = $BuildData.Channel.Replace(" ", "_")
        $PkgVer = $BuildData.Version
        $UploadDestURL = "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${PkgName}/${PkgVer}"

        $UploadParams = @{ UseBasicParsing = $true;
         Method = "PUT";
         Headers = @{
           "JOB-TOKEN" = "${CI_JOB_TOKEN}"; };
        If ($env:USE_SENTRY -eq 'TRUE') 
        {
          sentry-cli releases new $BuildChannelVersion
          sentry-cli releases set-commits --auto $BuildChannelVersion
        }

        Push-Location ./build-linux-64/newview/
          $FileNameLnx64 = Get-ChildItem -Path . -Name -Include Alchemy_*.tar.xz
          Invoke-WebRequest @UploadParams -InFile ./$FileNameLnx64 -Uri "${UploadDestURL}/${FileNameLnx64}"
        Push-Location ./build-darwin-64/
          Push-Location ./newview/
            $FileNameMac64 = Get-ChildItem -Path . -Name -Include Alchemy_*.dmg
            Invoke-WebRequest @UploadParams -InFile ./$FileNameMac64 -Uri "${UploadDestURL}/${FileNameMac64}"
          Pop-Location

          If ($env:USE_SENTRY -eq 'TRUE') 
          {
            sentry-cli upload-dif --include-sources newview/Release/
            sentry-cli upload-dif packages/
          }
Rye Mutt's avatar
Rye Mutt committed
        Pop-Location

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

          If ($env:USE_SENTRY -eq 'TRUE') 
          {
            sentry-cli upload-dif --include-sources newview/Release/alchemy-bin.*
            sentry-cli upload-dif packages/
          }

        If ($env:USE_SENTRY -eq 'TRUE') 
        {
          sentry-cli releases finalize $BuildChannelVersion
        }
Rye Mutt's avatar
Rye Mutt committed
upload:project:
  extends:
    - .upload_template
  rules:
    - if: '$BUILD_CHANNEL == "Project" && ($CI_PIPELINE_SOURCE == "web" || $CI_PIPELINE_SOURCE == "schedule")'
      when: manual
    - if: '$CI_COMMIT_TAG =~ /.*-project/'
      when: manual
Rye Mutt's avatar
Rye Mutt committed
  environment:
    name: qa
Rye Mutt's avatar
Rye Mutt committed
upload:beta:
  extends:
    - .upload_template
  rules:
    - if: '$BUILD_CHANNEL == "Beta" && ($CI_PIPELINE_SOURCE == "web" || $CI_PIPELINE_SOURCE == "schedule")'
      when: manual
    - if: '$CI_COMMIT_TAG =~ /.*-beta/'
      when: manual
Rye Mutt's avatar
Rye Mutt committed
  environment:
    name: beta
Rye Mutt's avatar
Rye Mutt committed
upload:release:
  extends:
    - .upload_template
  rules:
    - if: '$BUILD_CHANNEL == "Release" && ($CI_PIPELINE_SOURCE == "web" || $CI_PIPELINE_SOURCE == "schedule")'
      when: manual
    - if: '$CI_COMMIT_TAG =~ /.*-release/'
      when: manual
Rye Mutt's avatar
Rye Mutt committed
  environment: