Pour info, il a fallu que je créé une action guthub de release qui créé le fichier .zip.
En voici une qui marche:
name: Release
on:
release:
types: [published]
jobs:
release:
name: Prepare release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: "Set version number"
run: |
yq -i -o json '.version="${{ github.event.release.tag_name }}"' \
"${{ github.workspace }}/custom_components/versatile_thermostat/manifest.json"
# Pack the HACS dir as a zip and upload to the release
- name: ZIP Versatile Thermostat Dir
run: |
cd "${{ github.workspace }}/custom_components/versatile_thermostat"
zip versatile_thermostat.zip -r ./
- name: Upload zip to release
uses: softprops/action-gh-release@v2.2.1
with:
files: ${{ github.workspace }}/custom_components/versatile_thermostat/versatile_thermostat.zip
Ce qui permet aussi de mettre à jour automatiquement la release dans le manifest.json, un autre point qui me chatouillait depuis longtemps.
C’est presque étonnant que personne n’ait fait un github action qui fait ça…
EDIT: bon évidemment ça existe :
GitHub Actions can be used to ensure that all commits adhere to the Conventional Commits standard, which is a lightweight convention on top of commit messages that provides an easy set of rules for creating an explicit commit history.
One such action is the webiny/action-conventional-commits
, which ensures that all commit messages follow the Conventional Commits specification. This action can be integrated into a workflow file to validate commit messages during pull requests or other events.
Another action is ytanikin/pr-conventional-commits
, which checks that the pull request title adheres to the Conventional Commits specification. It can also validate ticket numbers and add labels based on the task type specified in the commit messages.
Additionally, the soamee/gh-action-conventional-commits
action is designed to automate the version bump for npm packages based on the commit messages, incrementing the version number according to the changes described in the commits.