Skip to content

Commit

Permalink
Cleanup PAT usage in ADO YAML
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Oct 5, 2024
1 parent 4e612b5 commit f9e8f52
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 126 deletions.
100 changes: 51 additions & 49 deletions build/DirectXMesh-GitHub-MinGW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ resources:
- repository: self
type: git
ref: refs/heads/main
- repository: vcpkgRepo
name: Microsoft/vcpkg
type: github
endpoint: microsoft
ref: refs/tags/$(VCPKG_TAG)
- repository: testRepo
name: walbourn/directxmeshtest
type: github
endpoint: microsoft
ref: refs/heads/main

name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)

Expand All @@ -56,8 +66,9 @@ pool:

variables:
Codeql.Enabled: false
VCPKG_CMAKE_DIR: '$(VCPKG_ROOT)/scripts/buildsystems/vcpkg.cmake'
GITHUB_PAT: $(GITHUBPUBLICTOKEN)
VCPKG_ROOT: $(Build.SourcesDirectory)/vcpkg
VCPKG_CMAKE_DIR: $(Build.SourcesDirectory)/vcpkg/scripts/buildsystems/vcpkg.cmake
VCPKG_MANIFEST_DIR: $(Build.SourcesDirectory)/build
URL_MINGW32: https://github.com/brechtsanders/winlibs_mingw/releases/download/12.2.0-14.0.6-10.0.0-ucrt-r2/winlibs-i686-posix-dwarf-gcc-12.2.0-llvm-14.0.6-mingw-w64ucrt-10.0.0-r2.zip
HASH_MINGW32: 'fcd1e11b896190da01c83d5b5fb0d37b7c61585e53446c2dab0009debc3915e757213882c35e35396329338de6f0222ba012e23a5af86932db45186a225d1272'

Expand All @@ -68,12 +79,14 @@ jobs:
- checkout: self
clean: true
fetchTags: false
- task: CmdLine@2
# We can use the preinstalled vcpkg instead of the latest when MS Hosted updates their vcpkg to the newer DirectX-Headers
fetchDepth: 1
path: 's'
- checkout: vcpkgRepo
displayName: Fetch VCPKG
inputs:
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/vcpkg.git
workingDirectory: $(Build.SourcesDirectory)
clean: true
fetchTags: false
fetchDepth: 1
path: 's/vcpkg'
- task: CmdLine@2
displayName: VCPKG Bootstrap
inputs:
Expand Down Expand Up @@ -110,30 +123,22 @@ jobs:
inputs:
script: g++ --version
- task: CmdLine@2
displayName: VCPKG install headers
displayName: VCPKG install packages
inputs:
script: |
call vcpkg install directxmath
@if ERRORLEVEL 1 goto error
call vcpkg install directx-headers
@if ERRORLEVEL 1 goto error
:finish
@echo --- VCPKG COMPLETE ---
exit /b 0
:error
@echo --- ERROR: VCPKG FAILED ---
exit /b 1
workingDirectory: $(Build.SourcesDirectory)\vcpkg
script: call vcpkg install --x-manifest-root=$(VCPKG_MANIFEST_DIR) --triplet=x86-mingw-static
workingDirectory: $(VCPKG_ROOT)
- task: CMake@1
displayName: CMake (MinGW32)
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: -B out -DCMAKE_BUILD_TYPE="Debug" -DDIRECTX_ARCH=x86 -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x86-mingw-static
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out -DCMAKE_BUILD_TYPE="Debug" -DDIRECTX_ARCH=x86
-DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles"
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x86-mingw-static
- task: CMake@1
displayName: CMake (MinGW32) Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out

- job: MINGW64_BUILD
Expand All @@ -142,15 +147,20 @@ jobs:
- checkout: self
clean: true
fetchTags: false
- task: CmdLine@2
fetchDepth: 1
path: 's'
- checkout: vcpkgRepo
displayName: Fetch VCPKG
inputs:
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/vcpkg.git
workingDirectory: $(Build.SourcesDirectory)
- task: CmdLine@2
displayName: Fetch tests
inputs:
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxmeshtest.git Tests
clean: true
fetchTags: false
fetchDepth: 1
path: 's/vcpkg'
- checkout: testRepo
displayName: Fetch Tests
clean: true
fetchTags: false
fetchDepth: 1
path: 's/Tests'
- task: CmdLine@2
displayName: VCPKG Bootstrap
inputs:
Expand All @@ -165,28 +175,20 @@ jobs:
inputs:
script: g++ --version
- task: CmdLine@2
displayName: VCPKG install headers
displayName: VCPKG install packages
inputs:
script: |
call vcpkg install directxmath
@if ERRORLEVEL 1 goto error
call vcpkg install directx-headers
@if ERRORLEVEL 1 goto error
:finish
@echo --- VCPKG COMPLETE ---
exit /b 0
:error
@echo --- ERROR: VCPKG FAILED ---
exit /b 1
workingDirectory: $(Build.SourcesDirectory)\vcpkg
script: call vcpkg install --x-manifest-root=$(VCPKG_MANIFEST_DIR) --triplet=x64-mingw-static
workingDirectory: $(VCPKG_ROOT)
- task: CMake@1
displayName: CMake (MinGW-W64)
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: -B out -DCMAKE_BUILD_TYPE="Debug" -DDIRECTX_ARCH=x64 -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x64-mingw-static
cwd: $(Build.SourcesDirectory)
cmakeArgs: >
-B out -DCMAKE_BUILD_TYPE="Debug" -DDIRECTX_ARCH=x64
-DCMAKE_CXX_COMPILER="g++.exe" -G "MinGW Makefiles"
-DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DVCPKG_MANIFEST_DIR="$(VCPKG_MANIFEST_DIR)" -DVCPKG_TARGET_TRIPLET=x64-mingw-static
- task: CMake@1
displayName: CMake (MinGW-W64) Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out
63 changes: 26 additions & 37 deletions build/DirectXMesh-GitHub-Test-Dev17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ resources:
type: git
ref: refs/heads/main
trigger: none
- repository: testRepo
name: walbourn/directxmeshtest
type: github
endpoint: microsoft
ref: refs/heads/main

name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)

Expand All @@ -37,7 +42,6 @@ pool:
variables:
Codeql.Enabled: false
VC_PATH: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
GITHUB_PAT: $(GITHUBPUBLICTOKEN)

jobs:
- job: DESKTOP_BUILD
Expand All @@ -48,19 +52,14 @@ jobs:
- checkout: self
clean: true
fetchTags: false
- task: DeleteFiles@1
displayName: Delete files from Tests
inputs:
SourceFolder: Tests
Contents: '**'
RemoveSourceFolder: true
RemoveDotFiles: true
- task: CmdLine@2
fetchDepth: 1
path: 's'
- checkout: testRepo
displayName: Fetch Tests
inputs:
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxmeshtest.git Tests
workingDirectory: $(Build.SourcesDirectory)
failOnStderr: true
clean: true
fetchTags: false
fetchDepth: 1
path: 's/Tests'
- task: VSBuild@1
displayName: Build solution DirectXMesh_Tests_Desktop_2022.sln 32dbg
inputs:
Expand Down Expand Up @@ -161,19 +160,14 @@ jobs:
- checkout: self
clean: true
fetchTags: false
- task: DeleteFiles@1
displayName: Delete files from Tests
inputs:
SourceFolder: Tests
Contents: '**'
RemoveSourceFolder: true
RemoveDotFiles: true
- task: CmdLine@2
fetchDepth: 1
path: 's'
- checkout: testRepo
displayName: Fetch Tests
inputs:
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxmeshtest.git Tests
workingDirectory: $(Build.SourcesDirectory)
failOnStderr: true
clean: true
fetchTags: false
fetchDepth: 1
path: 's/Tests'
- task: CmdLine@2
displayName: Setup environment for CMake to use VS
inputs:
Expand Down Expand Up @@ -248,19 +242,14 @@ jobs:
- checkout: self
clean: true
fetchTags: false
- task: DeleteFiles@1
displayName: Delete files from Tests
inputs:
SourceFolder: Tests
Contents: '**'
RemoveSourceFolder: true
RemoveDotFiles: true
- task: CmdLine@2
fetchDepth: 1
path: 's'
- checkout: testRepo
displayName: Fetch Tests
inputs:
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxmeshtest.git Tests
workingDirectory: $(Build.SourcesDirectory)
failOnStderr: true
clean: true
fetchTags: false
fetchDepth: 1
path: 's/Tests'
- task: CmdLine@2
displayName: Setup environment for CMake to use VS
inputs:
Expand Down
27 changes: 13 additions & 14 deletions build/DirectXMesh-GitHub-Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,19 @@ resources:
- repository: self
type: git
ref: refs/heads/main
- repository: testRepo
name: walbourn/directxmeshtest
type: github
endpoint: microsoft
ref: refs/heads/main

name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)

pool:
Codeql.Enabled: false
vmImage: windows-2019

variables:
GITHUB_PAT: $(GITHUBPUBLICTOKEN)
Codeql.Enabled: false

jobs:
- job: DESKTOP_BUILD
Expand All @@ -46,19 +50,14 @@ jobs:
- checkout: self
clean: true
fetchTags: false
- task: DeleteFiles@1
displayName: Delete files from Tests
inputs:
SourceFolder: Tests
Contents: '**'
RemoveSourceFolder: true
RemoveDotFiles: true
- task: CmdLine@2
fetchDepth: 1
path: 's'
- checkout: testRepo
displayName: Fetch Tests
inputs:
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxmeshtest.git Tests
workingDirectory: $(Build.SourcesDirectory)
failOnStderr: true
clean: true
fetchTags: false
fetchDepth: 1
path: 's/Tests'
- task: VSBuild@1
displayName: Build solution DirectXMesh_Tests_Desktop_2019.sln 32dbg
inputs:
Expand Down
41 changes: 28 additions & 13 deletions build/DirectXMesh-GitHub-WSL-11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ resources:
type: git
ref: refs/heads/main
trigger: none
- repository: dxHeadersRepo
name: Microsoft/DirectX-Headers
type: github
endpoint: microsoft
ref: refs/heads/main
- repository: dxMathRepo
name: Microsoft/DirectXMath
type: github
endpoint: microsoft
ref: refs/heads/main

name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)

Expand All @@ -39,7 +49,6 @@ pool:

variables:
Codeql.Enabled: false
GITHUB_PAT: $(GITHUBPUBLICTOKEN)
LOCAL_PKG_DIR: '$(Agent.BuildDirectory)/install/'

jobs:
Expand All @@ -51,10 +60,20 @@ jobs:
- checkout: self
clean: true
fetchTags: false
- task: CmdLine@2
displayName: Fetch directx-headers
inputs:
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/DirectX-Headers.git directx-headers
fetchDepth: 1
path: 's'
- checkout: dxHeadersRepo
displayName: Fetch DirectX-Headers
clean: true
fetchTags: false
fetchDepth: 1
path: 's/directx-headers'
- checkout: dxMathRepo
displayName: Fetch DirectX-Math
clean: true
fetchTags: false
fetchDepth: 1
path: 's/directxmath'
- task: CMake@1
displayName: CMake DirectX-Headers
inputs:
Expand All @@ -70,10 +89,6 @@ jobs:
inputs:
cwd: directx-headers
cmakeArgs: --install .
- task: CmdLine@2
displayName: Fetch directxmath
inputs:
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/DirectXMath.git directxmath
- task: CMake@1
displayName: CMake DirectXMath
inputs:
Expand Down Expand Up @@ -106,20 +121,20 @@ jobs:
- task: CMake@1
displayName: CMake DirectXMesh (Config) dbg
inputs:
cwd: '$(Build.SourcesDirectory)'
cwd: $(Build.SourcesDirectory)
cmakeArgs: -B out -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=$(LOCAL_PKG_DIR)/share;$(LOCAL_PKG_DIR)/cmake
- task: CMake@1
displayName: CMake DirectXMesh (Build) dbg
inputs:
cwd: '$(Build.SourcesDirectory)'
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out -v
- task: CMake@1
displayName: CMake DirectXMesh (Config) rel
inputs:
cwd: '$(Build.SourcesDirectory)'
cwd: $(Build.SourcesDirectory)
cmakeArgs: -B out2 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$(LOCAL_PKG_DIR)/share;$(LOCAL_PKG_DIR)/cmake
- task: CMake@1
displayName: CMake DirectXMesh (Build) rel
inputs:
cwd: '$(Build.SourcesDirectory)'
cwd: $(Build.SourcesDirectory)
cmakeArgs: --build out2 -v
Loading

0 comments on commit f9e8f52

Please sign in to comment.