Sha256: 62f9a0886b4499a2548bf08a8bfa48d99fa2e05b2fdb186443231abf8671a142

Contents?: true

Size: 1.02 KB

Versions: 9

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

module Dpl
  module Providers
    class Hackage < Provider
      register :hackage

      status :alpha

      description sq(<<-STR)
        tbd
      STR

      env :hackage

      opt '--username USER', 'Hackage username', required: true
      opt '--password USER', 'Hackage password', required: true, secret: true
      opt '--publish', 'Whether or not to publish the package'

      cmds check: 'cabal check',
           sdist: 'cabal sdist',
           upload: 'cabal upload %{upload_opts} %{path}'

      errs check: 'cabal check failed',
           sdist: 'cabal sdist failed',
           upload: 'cabal upload failed'

      def validate
        shell :check
      end

      def prepare
        shell :sdist
      end

      def deploy
        tar_files.each do |path|
          shell :upload, path:
        end
      end

      private

      def upload_opts
        opts_for(%i[publish username password])
      end

      def tar_files
        Dir.glob('dist/*.tar.gz').sort
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
dpl-2.0.5.2.beta.1 lib/dpl/providers/hackage.rb
dpl-2.0.5.1 lib/dpl/providers/hackage.rb
dpl-2.0.5.beta.2.1 lib/dpl/providers/hackage.rb
dpl-2.0.5.beta.2 lib/dpl/providers/hackage.rb
dpl-2.0.5 lib/dpl/providers/hackage.rb
dpl-2.0.5.beta.1 lib/dpl/providers/hackage.rb
dpl-2.0.5.beta lib/dpl/providers/hackage.rb
travis_dpl_test-2.0.3.beta.4.ror.1 lib/dpl/providers/hackage.rb
travis_dpl_test-2.0.3.beta.4.ror lib/dpl/providers/hackage.rb