Skip to content

fix: release workflow

ornanovitch requested to merge 149-peaufiner-encore-le-release-workflow into dev

Closes #149

Et voilà !

Il reste juste un petit souci et deux limitations

  • avec un simple commit fix() release-it nous sort une version mineure à la place d'un patch malgré le conventional-changelog. J'ai ouvert une ticket upstream car c'est clairement l'inverse de ce qui est censé arriver
  • on est obligé de pousser un commit vide dans la MR de préparation pour trigger le pipeline, car Gitlab ne prévoit pas de trigger sur une MR-pipeline en l'absence de commit
  • pour l'instant ce workflow ne permet pas de merge dans main une fois la préparation terminée, il faut donc ouvrir une merge request dédiée. Ce qui serait clean, c'est de trouver un moyen de fast-forward merge dev dans main automatiquement après la MR de préparation mergée. Ça nous enlève une étape manuelle + ça permet d'éviter de polluer l'historique de main avec des merge commit.
Dry-run
ornanovitch in ~/dev/FELINN/hiboo on 149-peaufiner-encore-le-release-workflow ● λ npx release-it --ci --config .release-it_dry-run.toml
$ git diff --quiet HEAD
$ git rev-parse --abbrev-ref HEAD
$ git config --get branch.149-peaufiner-encore-le-release-workflow.remote
$ git remote get-url origin
! git fetch
$ git rev-parse --abbrev-ref HEAD  [cached]
$ git -c "versionsort.suffix=-" for-each-ref --count=1 --sort=-v:refname --format="%(refname:short)" refs/tags/*
$ git symbolic-ref HEAD
$ git for-each-ref --format="%(upstream:short)" refs/heads/149-peaufiner-encore-le-release-workflow
$ git -c "versionsort.suffix=-" for-each-ref --count=1 --sort=-v:refname --format="%(refname:short)" refs/tags/*  [cached]
$ git rev-list 0.1.1..HEAD --count
🚀 Lets release hiboo (0.1.1...0.2.0)
Changelog:
## [0.2.0](https://forge.tedomum.net/acides/hiboo/compare/0.1.1...0.2.0) (2024-10-03)

### Bug Fixes
* add a commit for preparation ([c2a430a](https://forge.tedomum.net/acides/hiboo/commit/c2a430a94305967b5a0352eed56349146d6bd8b2))
* ci is not a config file option ([78ddc15](https://forge.tedomum.net/acides/hiboo/commit/78ddc154ff0e7e411bcb77704bea2ba563939c6c))
* comment and reorganize release-it files ([9a97cd7](https://forge.tedomum.net/acides/hiboo/commit/9a97cd7bbbbdf4865dd4b7adb400bdb82bfe59dc))
* do not tag in MR & dev, do tag in main ([8594c42](https://forge.tedomum.net/acides/hiboo/commit/8594c427b69398bccd78388c2607d9996d5ffadf))
* tagging policy ([894d951](https://forge.tedomum.net/acides/hiboo/commit/894d95189c8b1bf74acceeb4da3b82c6f8a2ea2e))
* typo ([c0abe67](https://forge.tedomum.net/acides/hiboo/commit/c0abe67faec62b4fa2183abe7c44e7536714cd9c))
$ Writing version to package.json
$ Writing version to pyproject.toml
$ Writing changelog to CHANGELOG.md
! git tag --annotate --message Release 0.2.0 0.2.0
$ git symbolic-ref HEAD  [cached]
$ git for-each-ref --format="%(upstream:short)" refs/heads/149-peaufiner-encore-le-release-workflow  [cached]
! git push --follow-tags
🏁 Done (in 1s.)
Prepare
ornanovitch in ~/dev/FELINN/hiboo on 149-peaufiner-encore-le-release-workflow ● λ npx release-it --ci --config .release-it_prepare.toml
$ git diff --quiet HEAD
$ git rev-parse --abbrev-ref HEAD
$ git config --get branch.149-peaufiner-encore-le-release-workflow.remote
$ git remote get-url origin
! git fetch
$ git rev-parse --abbrev-ref HEAD  [cached]
$ git -c "versionsort.suffix=-" for-each-ref --count=1 --sort=-v:refname --format="%(refname:short)" refs/tags/*
$ git symbolic-ref HEAD
$ git for-each-ref --format="%(upstream:short)" refs/heads/149-peaufiner-encore-le-release-workflow
$ git -c "versionsort.suffix=-" for-each-ref --count=1 --sort=-v:refname --format="%(refname:short)" refs/tags/*  [cached]
$ git rev-list 0.1.1..HEAD --count
🚀 Lets release hiboo (0.1.1...0.2.0)
Changelog:
## [0.2.0](https://forge.tedomum.net/acides/hiboo/compare/0.1.1...0.2.0) (2024-10-03)

### Bug Fixes
* add a commit for preparation ([c2a430a](https://forge.tedomum.net/acides/hiboo/commit/c2a430a94305967b5a0352eed56349146d6bd8b2))
* ci is not a config file option ([78ddc15](https://forge.tedomum.net/acides/hiboo/commit/78ddc154ff0e7e411bcb77704bea2ba563939c6c))
* comment and reorganize release-it files ([9a97cd7](https://forge.tedomum.net/acides/hiboo/commit/9a97cd7bbbbdf4865dd4b7adb400bdb82bfe59dc))
* do not tag in MR & dev, do tag in main ([8594c42](https://forge.tedomum.net/acides/hiboo/commit/8594c427b69398bccd78388c2607d9996d5ffadf))
* tagging policy ([894d951](https://forge.tedomum.net/acides/hiboo/commit/894d95189c8b1bf74acceeb4da3b82c6f8a2ea2e))
* typo ([c0abe67](https://forge.tedomum.net/acides/hiboo/commit/c0abe67faec62b4fa2183abe7c44e7536714cd9c))
$ Writing version to package.json
$ Writing version to pyproject.toml
$ Writing changelog to CHANGELOG.md
$ git status --short --untracked-files=no
Empty changeset
! git add . --update
! git commit --message chore(release): prepare for 0.2.0 release
$ git symbolic-ref HEAD  [cached]
$ git for-each-ref --format="%(upstream:short)" refs/heads/149-peaufiner-encore-le-release-workflow  [cached]
! git push --follow-tags
🏁 Done (in 1s.)
Publish
ornanovitch in ~/dev/FELINN/hiboo on 149-peaufiner-encore-le-release-workflow ● λ npx release-it --ci --config .release-it_publish.toml
$ git diff --quiet HEAD
$ git rev-parse --abbrev-ref HEAD
$ git config --get branch.149-peaufiner-encore-le-release-workflow.remote
$ git remote get-url origin
! git fetch
$ git rev-parse --abbrev-ref HEAD  [cached]
$ git -c "versionsort.suffix=-" for-each-ref --count=1 --sort=-v:refname --format="%(refname:short)" refs/tags/*
$ git symbolic-ref HEAD
$ git for-each-ref --format="%(upstream:short)" refs/heads/149-peaufiner-encore-le-release-workflow
$ git -c "versionsort.suffix=-" for-each-ref --count=1 --sort=-v:refname --format="%(refname:short)" refs/tags/*  [cached]
$ git rev-list 0.1.1..HEAD --count
🚀 Lets release hiboo (0.1.1...0.2.0)
Changelog:
## [0.2.0](https://forge.tedomum.net/acides/hiboo/compare/0.1.1...0.2.0) (2024-10-03)

### Bug Fixes
* add a commit for preparation ([c2a430a](https://forge.tedomum.net/acides/hiboo/commit/c2a430a94305967b5a0352eed56349146d6bd8b2))
* ci is not a config file option ([78ddc15](https://forge.tedomum.net/acides/hiboo/commit/78ddc154ff0e7e411bcb77704bea2ba563939c6c))
* comment and reorganize release-it files ([9a97cd7](https://forge.tedomum.net/acides/hiboo/commit/9a97cd7bbbbdf4865dd4b7adb400bdb82bfe59dc))
* do not tag in MR & dev, do tag in main ([8594c42](https://forge.tedomum.net/acides/hiboo/commit/8594c427b69398bccd78388c2607d9996d5ffadf))
* tagging policy ([894d951](https://forge.tedomum.net/acides/hiboo/commit/894d95189c8b1bf74acceeb4da3b82c6f8a2ea2e))
* typo ([c0abe67](https://forge.tedomum.net/acides/hiboo/commit/c0abe67faec62b4fa2183abe7c44e7536714cd9c))
$ Writing changelog to false
! git tag --annotate --message Release 0.2.0 0.2.0
$ git symbolic-ref HEAD  [cached]
$ git for-each-ref --format="%(upstream:short)" refs/heads/149-peaufiner-encore-le-release-workflow  [cached]
! git push --follow-tags
🏁 Done (in 1s.)
Edited by ornanovitch

Merge request reports