py-econometrics / pyfixest

Fast High-Dimensional Fixed Effects Regression in Python following fixest-syntax
https://py-econometrics.github.io/pyfixest/pyfixest.html
MIT License
117 stars 27 forks source link

Infra: Automate Publication of Release Notes on Github and Changelog #491

Closed s3alfisc closed 2 weeks ago

s3alfisc commented 3 weeks ago

Context

Currently, whenever a new version is released, I need to tag a new release on github "by hand" as well as update the changelog in the docs. There must be tools / gh actions out there to automate that procedure?

To do

sanskriti2005 commented 3 weeks ago

Hello! I would love to work on this. Can I be assigned to it?

s3alfisc commented 3 weeks ago

Yes, of course! I'll assign this to you then. Thank you =)

s3alfisc commented 3 weeks ago

Hi @sanskriti2005 , maybe you can take some inspiration from the pymc-marketing workflows that Juan has listed here: https://github.com/py-econometrics/pyfixest/issues/492#issuecomment-2156021566.

sanskriti2005 commented 3 weeks ago

Thank you for assigning this to me!

s3alfisc commented 3 weeks ago

Of course! =) Let me know if you stumble over any problems / if you need any help!

sanskriti2005 commented 2 weeks ago

Hello @s3alfisc !

Hope you had a lovely weekend.

I have a few suggestions and a few questions. I suggest the use of release-drafter tool. It is highly customizable and we can integrate it with GitHub Actions to automate the update of changelogs with every release.

My main question is about the changelogs itself, which, correct me if I'm wrong is this file. If it is, I want to know what kind of a format it should have for the automation.

Let me know what you think of the following workflow:

name: Release Drafter

on:
  push:
    branches:
      - master
permissions:
  contents: write
  pull-requests: write

jobs:
  update_release_draft:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Draft Release Notes
        uses: release-drafter/release-drafter@v6
        with:
          config-name: my-config.yml
          disable-autolabeler: true
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 

The file for the Release Notes draft format:

name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
categories:
  - title: 'New Features'
    labels:
      - 'enhancement'
  - title: 'Breaking Changes'
    labels:
      #What label should I put here?
  - title: 'Maintainence'
    labels:
      #What label should I put here?
  - title: 'Documentation'
    labels:
      -'documentation'
  - title: 'Infrastructure'
    labels:
      #What label should I put here?

change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' 
version-resolver:
  major:
    labels:
      - 'major'
  minor:
    labels:
      - 'minor'
  patch:
    labels:
      - 'patch'
  default: patch
template: |
  ## Changes

  $CHANGES

I'd like to thank you again and in advance for being so supportive and helpful!

s3alfisc commented 2 weeks ago

I'd like to thank you again and in advance for being so supportive and helpful!

Oh it's really up to me to thank you! =) This looks very good and the release-drafter seems to be the right tool for the job!

Yes, the changelog is in readme.qmd.

I have added three new labels"breaking changes", "infrastructure" and "maintenance". So I think you could put these into the wfl and open the PR =)

s3alfisc commented 2 weeks ago

For the versioning, I would suggest the following:

major: labels:

  • 'breaking change'
  • 'feature' minor: labels:
  • 'enhancement'
  • 'documentation' patch: labels:
  • 'maintenance'
  • 'infrastructure'

What do you think?