We can install preview using snaps. (It will always download the latest preview release)
here is gist link https://gist.github.com/iAmBipinPaul/ff94377254bb6467559ea705c84e4bf9
dist: xenial
addons:
snaps:
- name: dotnet-sdk
classic: true
channel: latest/beta
sudo: required
language: csharp
mono: none
script:
- sudo snap alias dotnet-sdk.dotnet dotnet
- dotnet --version