A bit late for this answer...
Firstly, use msbuild instead of xbuild as xbuild is deprecated.
Now, what you want is a successful build as well push the release to bitbucket downloads.
Here is how you do it:
1. Create an App password for the repository owner
Log in to Bitbucket as the repository owner (also the user who will upload the files) and go to Bitbucket Settings > App Passwords.
Create a new app password with write permissions to your repositories, and take note of the generated password that pops up. The name of the password is only for your reference, so use "Pipelines" or any other name you like.

You should now have two values that you will need for the next step.
<username>: Bitbucket username of the repository owner (and also the user who will upload the artifacts)
<password>: App password as generated by bitbucket
2. Create a Pipelines environment variable with the authentication token
Define a new secure environment variable in your Pipelines settings:
- Parameter name:
BB_AUTH_STRING
- Parameter value:
<username>:<password>
(using the values from step 1)
You can define this environment variable either in the repository settings, or in the settings for the account that owns the repository.
The example below shows the settings for an individual account environment variable, where the repository is owned by an individual. (Note that in the case where a team owns the repository, you must configure environment variables in the team settings for them to be visible in Pipelines.)

3. Enable your Pipeline to deploy your artifacts using curl and the Bitbucket REST API
First add line to zip your release dir:
- zip -j bin/Release.zip bin/Release/
It may be possible that the pipeline bash does not have zip installed. To install zip, add the following lines to your pipeline before the above command:
- apt-get update
- apt-get -y install zip
Now finally add the curl command that uses Bitbucket REST API:
- curl -X POST --user "${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"bin/Release.zip"
If you wish, you can remove the unneeded release zip file from the bin dir as the zip is now already in Bitbucket downloads:
- rm -f bin/Release.zip
Here is the full pipeline.yml:
image: mono
pipelines:
default:
- step:
script:
- nuget restore
- MONO_IOMAP=case msbuild /p:Configuration="Release" /p:Platform="AnyCPU" Solution.sln
- apt-get update
- apt-get -y install zip
- zip -r bin/Release.zip bin/Release/
- curl -X POST --user "${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"bin/Release.zip"
- rm -f bin/Release.zip
Note that your release directory may differ from the sample above