Sha256: 4c4d16cb056bc5b1d55e7a847d619b8cc35c45109182d266733b6c473f0b3f43

Contents?: true

Size: 1013 Bytes

Versions: 10

Compression:

Stored size: 1013 Bytes

Contents

module Dpl
  module Providers
    class Hackage < Provider
      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: 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

10 entries across 10 versions & 1 rubygems

Version Path
dpl-2.0.0.alpha.14 lib/dpl/providers/hackage.rb
dpl-2.0.0.alpha.13 lib/dpl/providers/hackage.rb
dpl-2.0.0.alpha.12 lib/dpl/providers/hackage.rb
dpl-2.0.0.alpha.11 lib/dpl/providers/hackage.rb
dpl-2.0.0.alpha.10 lib/dpl/providers/hackage.rb
dpl-2.0.0.alpha.9 lib/dpl/providers/hackage.rb
dpl-2.0.0.alpha.8 lib/dpl/providers/hackage.rb
dpl-2.0.0.alpha.7 lib/dpl/providers/hackage.rb
dpl-2.0.0.alpha.6 lib/dpl/providers/hackage.rb
dpl-2.0.0.alpha.5 lib/dpl/providers/hackage.rb