<commit_before>#!/usr/bin/env ruby
# uploads .deb and .rpm files to bintray

require_relative 'common'

module Itch
  def Itch.ci_deploy_bintray
    say "Should deploy to Bintray!"
    ✓ gem_dep 'dpl', 'dpl'

    FileUtils.mkdir_p "build"

    release_date = Time.now.strftime('%Y-%m-%d')
    %w(rpm deb).each do |repo|
      %w(386 amd64).each do |arch|
        say "Uploading #{arch} to #{repo} repo..."
        deb_arch = to_deb_arch arch
        rpm_arch = to_rpm_arch arch

        publish = (channel_name != 'stable')
        say "(and publishing)" if publish

        conf = File.read("release/templates/bintray.#{repo}.json.in")
        conf = conf.gsub "{{CI_APPNAME}}", app_name
        conf = conf.gsub "{{CI_VERSION}}", build_version
        conf = conf.gsub "{{CI_RELEASE_DATE}}", release_date
        conf = conf.gsub "{{CI_PUBLISH}}", publish.to_s
        conf = conf.gsub "{{DEB_ARCH}}", deb_arch
        conf = conf.gsub "{{RPM_ARCH}}", rpm_arch
        File.write("build/bintray.json", conf)

        ✓ qsh %Q{dpl --provider=bintray --file=build/bintray.json --user=fasterthanlime --key="#{ENV['BINTRAY_TOKEN']}"}
      end # 386, amd64
    end # deb, rpm
  end
end
<commit_msg>Don't upload kitch/canary builds to bintray to avoid being rate-limited.<commit_after>#!/usr/bin/env ruby
# uploads .deb and .rpm files to bintray

require_relative 'common'

module Itch
  def Itch.ci_deploy_bintray
    if channel_name == "canary"
      say "Skipping bintray deploy for canary versions"
      return
    end

    say "Deploying to Bintray!"
    ✓ gem_dep 'dpl', 'dpl'

    FileUtils.mkdir_p "build"

    release_date = Time.now.strftime('%Y-%m-%d')
    %w(rpm deb).each do |repo|
      %w(386 amd64).each do |arch|
        say "Uploading #{arch} to #{repo} repo..."
        deb_arch = to_deb_arch arch
        rpm_arch = to_rpm_arch arch

        publish = (channel_name != 'stable')
        say "(and publishing)" if publish

        conf = File.read("release/templates/bintray.#{repo}.json.in")
        conf = conf.gsub "{{CI_APPNAME}}", app_name
        conf = conf.gsub "{{CI_VERSION}}", build_version
        conf = conf.gsub "{{CI_RELEASE_DATE}}", release_date
        conf = conf.gsub "{{CI_PUBLISH}}", publish.to_s
        conf = conf.gsub "{{DEB_ARCH}}", deb_arch
        conf = conf.gsub "{{RPM_ARCH}}", rpm_arch
        File.write("build/bintray.json", conf)

        ✓ qsh %Q{dpl --provider=bintray --file=build/bintray.json --user=fasterthanlime --key="#{ENV['BINTRAY_TOKEN']}"}
      end # 386, amd64
    end # deb, rpm
  end
end

{'fraction_non_alphanumeric': 0.14626515447790378, 'fraction_numerical': 0.007821666014861166, 'mean_word_length': 2.7840236686390534, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5602427', 'n_tokens_mistral': 960, 'n_tokens_neox': 908, 'n_words': 218}