|
27 | 27 | tenant-id: ${{ secrets.AZURE_TENANT_ID }} |
28 | 28 | subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} |
29 | 29 |
|
30 | | - - name: Publish manifest with winget-create |
| 30 | + - name: Create manifests with winget-create |
| 31 | + id: manifests |
31 | 32 | run: | |
32 | 33 | # Enabling stop on error and tracing |
33 | 34 | Set-PSDebug -Trace 2 |
@@ -72,12 +73,30 @@ jobs: |
72 | 73 | "$($asset_arm64_url)|arm64|machine" ` |
73 | 74 | "$($asset_arm64_url)|arm64|user" |
74 | 75 |
|
75 | | - # Download the token from Azure Key Vault and mask it in the logs |
76 | | - az keyvault secret download --name ${{ secrets.WINGET_TOKEN_SECRET_NAME }} --vault-name ${{ secrets.AZURE_VAULT }} --file token.txt |
77 | | - Write-Host -NoNewLine "::add-mask::$(Get-Content token.txt)" |
| 76 | + # Output the version and tag name for use in the next step |
| 77 | + "version=$version" >> $env:GITHUB_OUTPUT |
| 78 | + "tag_name=$env:TAG_NAME" >> $env:GITHUB_OUTPUT |
| 79 | + shell: powershell |
| 80 | + |
| 81 | + - name: Retrieve winget token |
| 82 | + id: token |
| 83 | + run: | |
| 84 | + $token = az keyvault secret show ` |
| 85 | + --name ${{ secrets.WINGET_TOKEN_SECRET_NAME }} ` |
| 86 | + --vault-name ${{ secrets.AZURE_VAULT }} ` |
| 87 | + --query "value" -o tsv |
| 88 | + if ([string]::IsNullOrWhiteSpace($token)) { |
| 89 | + throw "Failed to retrieve token from Azure Key Vault" |
| 90 | + } |
| 91 | + Write-Host -NoNewLine "::add-mask::$token" |
| 92 | + "result=$token" >> $env:GITHUB_OUTPUT |
| 93 | + shell: powershell |
78 | 94 |
|
79 | | - # Submit the manifest to the winget-pkgs repository |
80 | | - $manifestDirectory = "$PWD\manifests\m\Microsoft\Git\$version" |
81 | | - Write-Host -NoNewLine "::notice::Submitting ${env:TAG_NAME} to winget... " |
82 | | - .\wingetcreate.exe submit -t "$(Get-Content token.txt)" $manifestDirectory |
| 95 | + - name: Submit manifest to winget-pkgs |
| 96 | + run: | |
| 97 | + $manifestDirectory = "$PWD\manifests\m\Microsoft\Git\${{ steps.manifests.outputs.version }}" |
| 98 | + Write-Host -NoNewLine "::notice::Submitting ${{ steps.manifests.outputs.tag_name }} to winget... " |
| 99 | + .\wingetcreate.exe submit $manifestDirectory |
83 | 100 | shell: powershell |
| 101 | + env: |
| 102 | + WINGET_CREATE_GITHUB_TOKEN: ${{ steps.token.outputs.result }} |
0 commit comments