f3ath / cider

Tools for Dart package maintainers
https://pub.dev/packages/cider
MIT License
101 stars 17 forks source link

Support for listing versions #48

Closed clragon closed 1 year ago

clragon commented 1 year ago

Cider supports printing out the changelog for a version with cider describe [<version>]

This is incredibly useful for CI. However, I have a script in which I would like to generate a changelog file for each version. To do so, I would need to know which versions are available.

Would it be possible to add a command that prints all versions in the changelog?

f3ath commented 1 year ago

Not sure I completely understand the idea. Can you maybe give a short example?

clragon commented 1 year ago

sure thing.

lets assume

# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- New feature to allow user to sort their task list.
- Support for Android 13.

### Fixed

- Bug where app would crash on iOS 15 when opening the task details screen.

## [2.0.1] - 2023-05-30

### Fixed

- Bug where application crashes when deleting a task on Windows.
- Memory leak issue when the application stays open for a long time on macOS.

## [2.0.0] - 2023-05-01

### Added

- Feature to synchronize tasks across multiple devices.
- Support for iOS 15 and macOS Monterey.
- Introduced dark theme.

### Changed

- Updated user interface to be more intuitive.
- Updated internal task storage to improve performance.

### Removed

- Deprecated 'quick add' feature due to lack of use.

## [1.1.0] - 2023-01-01

### Added

- Notifications for due tasks.
- User preference settings.

### Fixed

- Problem where tasks weren't saving correctly on some Android devices.

## [1.0.0] - 2022-08-15

### Added

- Initial release.
- Basic task management functionality.

[Unreleased]: https://github.com/yourusername/yourproject/compare/v2.0.1...HEAD
[2.0.1]: https://github.com/yourusername/yourproject/compare/v2.0.0...v2.0.1
[2.0.0]: https://github.com/yourusername/yourproject/compare/v1.1.0...v2.0.0
[1.1.0]: https://github.com/yourusername/yourproject/compare/v1.0.0...v1.1.0
[1.0.0]: https://github.com/yourusername/yourproject/releases/tag/v1.0.0

I can currently do

$ cider describe 1.0.0

to get

## [1.0.0] - 2022-08-15

### Added

- Initial release.
- Basic task management functionality.

[1.0.0]: https://github.com/yourusername/yourproject/releases/tag/v1.0.0

I would additionally like

$ cider list

to get

Unreleased
2.0.1
2.0.0
1.1.0
1.0.0

which I could then use in combination with describe to write a changelog file for each version. This is very handy for releasing in the Google PlayStore.

clragon commented 1 year ago

(it would also be really really nice if describe allowed getting only the body, without the title and the link at the end. perhaps as an optional flag. but maybe thats better for another issue)

f3ath commented 1 year ago

Hey @clragon wanna try the list command? https://pub.dev/packages/cider/versions/0.2.0-alpha.2

clragon commented 1 year ago

that works brilliantly!

f3ath commented 1 year ago

Implemented in 0.2.

clragon commented 1 year ago

with this, my fastlane for writing changelogs can now look like this:

  desc "Writes playstore changelogs from CHANGELOG.md"
  lane :changelog do
    sh("dart pub global activate cider")
    versions = sh("cider list").split("\n")
    versions.each do |version|
      build_number = version.split('+').last
      description = sh("cider describe #{version} --only-body")
      changelogs = "./metadata/android/en-US/changelogs"
      FileUtils.mkdir_p(changelogs)
      File.open("#{changelogs}/#{build_number}.txt", 'w') do |file|
        file.write(description)
      end
    end
  end

which is amazing. all the parsing is now done by cider.