Skip to content
Merged
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
30 changes: 15 additions & 15 deletions .github/workflows/sign-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# How it works:
# - ADO pipeline is configured to use this YAML from the tgrep GitHub repo
# - OneBranch checks out tgrep source to $(Build.SourcesDirectory)\s via 'checkout: self'
# - OneBranch auto-checks out tgrep source to $(Build.SourcesDirectory)\s (no checkout: self needed)
# (OneBranch convention: single-repo checkout lands in the 's' subdirectory)
# - Rust is installed via RustInstaller@1 (official Microsoft ADO task)
# - Cargo is authenticated to ADO DeepPrompt feed via CargoAuthenticate@0
Expand Down Expand Up @@ -134,7 +134,7 @@ extends:
# of truth; it has been removed since it is no longer referenced.)
# ---------------------------------------------------------------
- powershell: |
$dstDir = "$(Build.SourcesDirectory)\tgrep\.cargo"
$dstDir = "$(Build.SourcesDirectory)\s\.cargo"
New-Item -ItemType Directory -Force -Path $dstDir | Out-Null
$lines = @(
'[registries.devdiv-deepprompt]',
Expand Down Expand Up @@ -165,23 +165,23 @@ extends:
- task: CargoAuthenticate@0
displayName: 'Authenticate with ADO DeepPrompt Cargo feed'
inputs:
configFile: 'tgrep/.cargo/config.toml'
configFile: 's/.cargo/config.toml'

# ---------------------------------------------------------------
# Step 6: Build Windows x64 release binary
# ---------------------------------------------------------------
- script: |
cargo build --release --locked -p tgrep-cli --bin tgrep --target x86_64-pc-windows-msvc
displayName: 'Build tgrep Windows x64'
workingDirectory: $(Build.SourcesDirectory)\tgrep
workingDirectory: $(Build.SourcesDirectory)\s

# ---------------------------------------------------------------
# Step 7: Verify binary exists
# ---------------------------------------------------------------
- script: |
dir target\x86_64-pc-windows-msvc\release\tgrep.exe
displayName: 'Verify tgrep.exe exists'
workingDirectory: $(Build.SourcesDirectory)\tgrep
workingDirectory: $(Build.SourcesDirectory)\s

# ---------------------------------------------------------------
# Step 8: Sign tgrep.exe using OneBranch signing
Expand All @@ -195,7 +195,7 @@ extends:
command: "sign"
signing_profile: "external_distribution"
files_to_sign: "tgrep.exe"
search_root: "$(Build.SourcesDirectory)/tgrep/target/x86_64-pc-windows-msvc/release"
search_root: "$(Build.SourcesDirectory)/s/target/x86_64-pc-windows-msvc/release"

# ---------------------------------------------------------------
# Step 9: Package signed binary
Expand All @@ -204,8 +204,8 @@ extends:
- powershell: |
$tag = "$(TGREP_TAG)"
$zipName = "tgrep-$tag-x86_64-pc-windows-msvc.zip"
$exePath = "$(Build.SourcesDirectory)/tgrep/target/x86_64-pc-windows-msvc/release/tgrep.exe"
$readmePath = "$(Build.SourcesDirectory)/tgrep/README.md"
$exePath = "$(Build.SourcesDirectory)/s/target/x86_64-pc-windows-msvc/release/tgrep.exe"
$readmePath = "$(Build.SourcesDirectory)/s/README.md"
$outPath = "$(Build.ArtifactStagingDirectory)/$zipName"
Compress-Archive -Path $exePath, $readmePath -DestinationPath $outPath
Write-Host "Packaged: $zipName"
Expand Down Expand Up @@ -269,7 +269,7 @@ extends:
displayName: 'Verify Rust version'

- powershell: |
$dstDir = "$(Build.SourcesDirectory)\tgrep\.cargo"
$dstDir = "$(Build.SourcesDirectory)\s\.cargo"
New-Item -ItemType Directory -Force -Path $dstDir | Out-Null
$lines = @(
'[registries.devdiv-deepprompt]',
Expand Down Expand Up @@ -297,31 +297,31 @@ extends:
- task: CargoAuthenticate@0
displayName: 'Authenticate with ADO DeepPrompt Cargo feed'
inputs:
configFile: 'tgrep/.cargo/config.toml'
configFile: 's/.cargo/config.toml'

- script: |
cargo build --release --locked -p tgrep-cli --bin tgrep --target aarch64-pc-windows-msvc
displayName: 'Build tgrep Windows arm64 (cross-compile)'
workingDirectory: $(Build.SourcesDirectory)\tgrep
workingDirectory: $(Build.SourcesDirectory)\s

- script: |
dir target\aarch64-pc-windows-msvc\release\tgrep.exe
displayName: 'Verify tgrep.exe (arm64) exists'
workingDirectory: $(Build.SourcesDirectory)\tgrep
workingDirectory: $(Build.SourcesDirectory)\s

- task: onebranch.pipeline.signing@1
displayName: 'Sign tgrep.exe (arm64)'
inputs:
command: "sign"
signing_profile: "external_distribution"
files_to_sign: "tgrep.exe"
search_root: "$(Build.SourcesDirectory)/tgrep/target/aarch64-pc-windows-msvc/release"
search_root: "$(Build.SourcesDirectory)/s/target/aarch64-pc-windows-msvc/release"

- powershell: |
$tag = "$(TGREP_TAG)"
$zipName = "tgrep-$tag-aarch64-pc-windows-msvc.zip"
$exePath = "$(Build.SourcesDirectory)/tgrep/target/aarch64-pc-windows-msvc/release/tgrep.exe"
$readmePath = "$(Build.SourcesDirectory)/tgrep/README.md"
$exePath = "$(Build.SourcesDirectory)/s/target/aarch64-pc-windows-msvc/release/tgrep.exe"
$readmePath = "$(Build.SourcesDirectory)/s/README.md"
$outPath = "$(Build.ArtifactStagingDirectory)/$zipName"
Compress-Archive -Path $exePath, $readmePath -DestinationPath $outPath
Write-Host "Packaged: $zipName"
Expand Down
Loading