Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,43 @@ extends:
rustc --version
cargo --version

# Configure Cargo to use Azure Artifacts feed with auth
- task: PowerShell@2
displayName: Configure Cargo for Azure Artifacts feed
inputs:
targetType: inline
script: |
$feedUrl = "sparse+https://pkgs.dev.azure.com/microsoft/pde-oss/_packaging/dynwinrt-cargo/Cargo/index/"

# Project-level config: registry + source replacement
New-Item -ItemType Directory -Path .cargo -Force | Out-Null
@"
[registries]
dynwinrt-cargo = { index = "$feedUrl" }

[source.crates-io]
replace-with = "dynwinrt-cargo"

[source.dynwinrt-cargo]
registry = "$feedUrl"
"@ | Set-Content .cargo/config.toml

# User-level config: credential providers
$userConfig = "$env:USERPROFILE\.cargo\config.toml"
New-Item -ItemType Directory -Path "$env:USERPROFILE\.cargo" -Force | Out-Null
@"
[registry]
global-credential-providers = ["cargo:token", "cargo:wincred"]
"@ | Set-Content $userConfig

# Login with System.AccessToken
$token = "Basic " + [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("PAT:$env:SYSTEM_ACCESSTOKEN"))
cargo login --registry dynwinrt-cargo "$token"

Write-Host "Configured Cargo feed with auth"
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)

# Core library tests
- task: PowerShell@2
displayName: Test core library
Expand Down Expand Up @@ -81,6 +118,23 @@ extends:
script: cargo build -p winrt-meta --release --target aarch64-pc-windows-msvc

# Build dynwinrt-js (x64 + arm64)
- task: PowerShell@2
displayName: Configure npm for Azure Artifacts feed
inputs:
targetType: inline
workingDirectory: bindings/js
script: |
@"
registry=https://pkgs.dev.azure.com/microsoft/pde-oss/_packaging/dynwinrt-npm/npm/registry/
always-auth=true
"@ | Set-Content .npmrc
Write-Host "Configured .npmrc for Azure Artifacts"

- task: npmAuthenticate@0
displayName: Authenticate npm feed
inputs:
workingFile: bindings/js/.npmrc

- task: PowerShell@2
displayName: Install JS binding dependencies
inputs:
Expand Down
54 changes: 54 additions & 0 deletions .pipelines/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,43 @@ extends:
rustc --version
cargo --version

# Configure Cargo to use Azure Artifacts feed with auth
- task: PowerShell@2
displayName: Configure Cargo for Azure Artifacts feed
inputs:
targetType: inline
script: |
$feedUrl = "sparse+https://pkgs.dev.azure.com/microsoft/pde-oss/_packaging/dynwinrt-cargo/Cargo/index/"

# Project-level config: registry + source replacement
New-Item -ItemType Directory -Path .cargo -Force | Out-Null
@"
[registries]
dynwinrt-cargo = { index = "$feedUrl" }

[source.crates-io]
replace-with = "dynwinrt-cargo"

[source.dynwinrt-cargo]
registry = "$feedUrl"
"@ | Set-Content .cargo/config.toml

# User-level config: credential providers
$userConfig = "$env:USERPROFILE\.cargo\config.toml"
New-Item -ItemType Directory -Path "$env:USERPROFILE\.cargo" -Force | Out-Null
@"
[registry]
global-credential-providers = ["cargo:token", "cargo:wincred"]
"@ | Set-Content $userConfig

# Login with System.AccessToken
$token = "Basic " + [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("PAT:$env:SYSTEM_ACCESSTOKEN"))
cargo login --registry dynwinrt-cargo "$token"

Write-Host "Configured Cargo feed with auth"
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)

# Build winrt-meta (x64 + arm64)
- task: PowerShell@2
displayName: Build winrt-meta (x64)
Expand All @@ -86,6 +123,23 @@ extends:
Copy-Item target/aarch64-pc-windows-msvc/release/winrt-meta.exe tools/winrt-meta/npm/bin/arm64/

# Build dynwinrt-js (x64 + arm64)
- task: PowerShell@2
displayName: Configure npm for Azure Artifacts feed
inputs:
targetType: inline
workingDirectory: bindings/js
script: |
@"
registry=https://pkgs.dev.azure.com/microsoft/pde-oss/_packaging/dynwinrt-npm/npm/registry/
always-auth=true
"@ | Set-Content .npmrc
Write-Host "Configured .npmrc for Azure Artifacts"

- task: npmAuthenticate@0
displayName: Authenticate npm feed
inputs:
workingFile: bindings/js/.npmrc

- task: PowerShell@2
displayName: Install JS binding dependencies
inputs:
Expand Down
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ members = [
"tools/winrt-meta",
]
resolver = "2"

[workspace.package]
license = "MIT"

[profile.release]
Expand Down
Loading