Coder Social home page Coder Social logo

releaser's Introduction

Releaser

Automation of Haskell package release process.

Example usage

$ releaser
>> Assserting there are no uncommitted files
>> Looking for a cabal file in .
>> Found releaser-0.1.0.0
>> Bump cabal version from 0.1.0.0 to: 0.1.0.0
>> Bumped releaser to 0.1.0.0
>> Running $ git checkout -b v0.1.0.0
Switched to a new branch 'v0.1.0.0'
>> Assserting there are no uncommitted files
>> Running $ cabal dist
>> Looking for a cabal file in .
>> Found releaser-0.1.0.0
Warning: The sdist command is a part of the legacy v1 style of cabal usage.

Please switch to using either the new project style and the new-sdist command
or the legacy v1-sdist alias as new-style projects will become the default in
the next version of cabal-install. Please file a bug if you cannot replicate a
working v1- use case with the new-style commands.

For more information, see: https://wiki.haskell.org/Cabal/NewBuild

>> Created dist/releaser-0.1.0.0.tar.gz
>> Running $ git commit 
>> Running $ git tag --annotate --sign v0.1.0.0
>> Pushing git to origin
Enumerating objects: 25, done.
Counting objects: 100% (25/25), done.
Delta compression using up to 8 threads
Compressing objects: 100% (13/13), done.
Writing objects: 100% (19/19), 3.37 KiB | 3.37 MiB/s, done.
Total 19 (delta 8), reused 0 (delta 0)
remote: Resolving deltas: 100% (8/8), completed with 3 local objects.
remote: 
remote: Create a pull request for 'v0.1.0.0' on GitHub by visiting:
remote:      https://github.com/domenkozar/releaser/pull/new/v0.1.0.0
remote: 
To https://github.com/domenkozar/releaser.git
 * [new branch]      HEAD -> v0.1.0.0
>> Pushing git to origin
Enumerating objects: 1, done.
Counting objects: 100% (1/1), done.
Writing objects: 100% (1/1), 540 bytes | 540.00 KiB/s, done.
Total 1 (delta 0), reused 0 (delta 0)
To https://github.com/domenkozar/releaser.git
 * [new tag]         v0.1.0.0 -> v0.1.0.0
>> Running $ cabal upload
ploading dist/releaser-0.1.0.0.tar.gz...
Package successfully published. You can now view it at
'https://hackage.haskell.org/package/releaser-0.1.0.0'.

Features

  • Releaser.Primitives module provides a bunch of functions to help automating release process.

  • releaser executable provides interactive automation for releasing package to Hackage and git.

Design decisions

  • When there's a choice for configuration, prefer a convention and avoid configuration.

  • Log each primitive action

Prior art

releaser's People

Contributors

domenkozar avatar maralorn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

releaser's Issues

Incompatibility with Cabal 3.6

Build error with ghc 9.4 during the ongoing nixpkgs update to LTS 21.

https://hydra.nixos.org/build/227407882/nixlog/2/tail

[1 of 1] Compiling Releaser.Primitives ( src/Releaser/Primitives.hs, dist/build/Releaser/Primitives.o, dist/build/Releaser/Primitives.dyn_o )

src/Releaser/Primitives.hs:77:32: error:
    Variable not in scope:
      readGenericPackageDescription
        :: Distribution.Verbosity.Verbosity
           -> FilePath
           -> IO
                Distribution.Types.GenericPackageDescription.GenericPackageDescription
    Suggested fix:
      Perhaps use ‘parseGenericPackageDescription’ (imported from Distribution.PackageDescription.Parsec)
   |
77 |   genericPackageDescription <- readGenericPackageDescription silent cabalFile
   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This looks like an API change in Cabal.

I don’t know if you still use/are interested in this package. I am happy to fix this somehow in nixpkgs, if you like. I would also be fine to drop it, if you don’t care.

Pre-filled link to create github release

Just figured out this is feasible. Can't do it now, so writing down the details

  • read the tag message into variable
  • figure out github repo url
    • parse from git remote get-url origin, turn into https variant, strip .git
  • print link to https://github.com/someAccount/someRepo/releases/new?tag=the-tag-0.1&title=the-tag-0.1&body=theTagMessage

Multi package support

If there are two or more cabal files in a repo, there's a bit different workflow needed than what currently releaser does.

releaser package1 package2 should tag package1-${version}, package2-${version}.

Graceful error-handling

At the moment it is very hard to run releaser again, if it failed for some reason (e.g. a hackage network outage).

Rerunning releaser you run into the following problems:

  • The changelog commit will fail, because you are trying to commit without any changes.
  • You can‘t upload the tag to origin because it already exists.

It might be useful to check for this situations and jump the failing steps if necessary.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.