@@ -135,8 +135,9 @@ jobs:
135135 run : |
136136 $token = "${{ secrets.GITHUB_TOKEN }}"
137137 $registry = "${{ env.REGISTRY }}"
138- $repo = "${{ env.IMAGE_NAME }}"
138+ $repo = "${{ env.IMAGE_NAME }}".ToLower()
139139 $version = "${{ steps.get_version.outputs.VERSION }}"
140+ $username = "${{ github.actor }}"
140141
141142 # Create manifest file
142143 $manifest = @{
@@ -148,22 +149,30 @@ jobs:
148149 } | ConvertTo-Json
149150 $manifest | Out-File -FilePath manifest.json -Encoding UTF8
150151
151- # Push binary and files to GitHub Packages
152- .\oras.exe push "${registry}/${repo}:${version}" `
153- --username "${{ github.actor }}" `
154- --password "$token" `
155- gopolicy.exe:application/vnd.microsoft.windows.executable `
156- README.md:text/plain `
157- LICENSE:text/plain `
158- manifest.json:application/json
152+ # Push binary and files to GitHub Packages using password-stdin
153+ $orasArgs = @(
154+ "push",
155+ "${registry}/${repo}:${version}",
156+ "--username", $username,
157+ "--password-stdin",
158+ "gopolicy.exe:application/vnd.microsoft.windows.executable",
159+ "README.md:text/plain",
160+ "LICENSE:text/plain",
161+ "manifest.json:application/json"
162+ )
163+ $token | .\oras.exe $orasArgs
159164
160165 # Also tag as latest
161- .\oras.exe push "${registry}/${repo}:latest" `
162- --username "${{ github.actor }}" `
163- --password "$token" `
164- gopolicy.exe:application/vnd.microsoft.windows.executable `
165- README.md:text/plain `
166- LICENSE:text/plain `
167- manifest.json:application/json
166+ $orasArgsLatest = @(
167+ "push",
168+ "${registry}/${repo}:latest",
169+ "--username", $username,
170+ "--password-stdin",
171+ "gopolicy.exe:application/vnd.microsoft.windows.executable",
172+ "README.md:text/plain",
173+ "LICENSE:text/plain",
174+ "manifest.json:application/json"
175+ )
176+ $token | .\oras.exe $orasArgsLatest
168177
169- Write-Output "Pushed to GitHub Packages: ${registry}/${repo}:${version}"
178+ Write-Output "Successfully pushed to GitHub Packages: ${registry}/${repo}:${version}"
0 commit comments