Automatic Rename
When build artifacts with the extensions appx and nupkg are uploaded, build-agent recognizes them as zip files due to them technically being the same, and will automatically attach a content type of application/zip. build-agent uses the following go package to determine the MIME type:
Workaround
There is a workaround by specifying the content type in /etc/mime.types
file or for the Windows executor, a modification in the registry is necessary. This configuration allows appx and nupkg files to retain the content type of application/octet-stream
.
Windows
- run:
name: Adding MIME types for MSIX
shell: powershell.exe
command: |
reg add HKCR\.appx /v "Content Type" /t REG_SZ /d "application/vns.ms-appx"
reg add HKCR\.nupkg /v "Content Type" /t REG_SZ /d "application/vns.ms-appx"
Linux
- run:
name: Adding MIME types
command: |
sudo bash -c "echo 'application/octet-stream nupkg' >> /etc/mime.types"
sudo bash -c "echo 'application/octet-stream appx' >> /etc/mime.types"
Comments
Article is closed for comments.