trigger: - main pool: vmImage: 'ubuntu-latest' steps: - task: UseRubyVersion@0 inputs: versionSpec: '>= 2.7.1' addToPath: true displayName: 'Installing Ruby' - script: | which ruby - script: | gem install bundler bundle install --retry=3 --jobs=4 displayName: 'Installing Bundler and Gems' - script: | mkdir -p $HOME/.gem touch $HOME/.gem/credentials chmod 0600 $HOME/.gem/credentials echo '---\n:rubygems_api_key: rubygems_a9c2d2bd97f996d6c2819d4bc61dd2dcdd474ff09034d60c' >> $HOME/.gem/credentials gem build SaudeiD.gemspec displayName: Build Gem - script: | GEM_VERSION=$(cat lib/SaudeiD/version.rb | grep -P '\d\.\d\.\d' -o) gem push SaudeiD-$GEM_VERSION.gem displayName: Publish Gem