Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Semantic-Release workflow #64

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/checkCommit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This workflow check pull-requests commit message validity
name: "Check Commit message for Semantic validity"

on:
# this workflow triggers only on Pull Requests
pull_request:
branches: [ master, beta, dev ]
types: [ opened, reopened, synchronize, edited ]

jobs:
# one single job, import from jeedom/workflows
checkCommit:
# https://github.com/jeedom/workflows/blob/main/.github/workflows/checkCommit.yml
uses: jeedom/workflows/.github/workflows/checkCommit.yml@main
30 changes: 30 additions & 0 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# this workflow runs Semantic-Release on current branch
# - list new commits with conventional-commit messages
# - update changelog.md (or changelog_beta.md)
# - update version number into plugin_info/info.json
# - generate a new tag with the new version
# - publish a new Github package
# - generate vars.env file with the version number for future workflow steps
name: Semantic Release

on:
push:
branches: [ master, beta, dev ]
pull_request:
branches: [ master, beta, dev ]
# this is to manually trigger the worklow
workflow_dispatch:
inputs:
logLevel:
description: 'Reason'
default: 'Manual launch'

env:
# branch name must be 'beta' for beta branch
BRANCH_NAME: ${{ github.ref_name }}

jobs:
# one single job, import from jeedom/workflows
release:
# https://github.com/jeedom/workflows/blob/main/.github/workflows/semantic-release.yml
uses: jeedom/workflows/.github/workflows/semantic-release.yml@main
81 changes: 78 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Template de plugin pour Jeedom

![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
[![Build Master](https://github.com/pifou25/plugin-template/actions/workflows/semantic-release.yml/badge.svg?branch=master)](https://github.com/pifou25/plugin-template/actions/workflows/semantic-release.yml)
![GitHub release (with filter)](https://img.shields.io/github/v/release/pifou25/plugin-template)

Validation PHP Version (branche BETA) :

![PHP 7.3](https://github.com/jeedom/plugin-template/actions/workflows/lint_Php73.yml/badge.svg?branch=beta)
![PHP 7.4](https://github.com/jeedom/plugin-template/actions/workflows/lint_Php74.yml/badge.svg?branch=beta)

Validation Code int (branche BETA):

![PHP](https://github.com/jeedom/plugin-template/actions/workflows/php.yml/badge.svg?branch=beta)
![PHP](https://github.com/jeedom/plugin-template/actions/workflows/codeLintGlobal.yml/badge.svg?branch=beta)


Validation PHP Version (branche MASTER) :

![PHP 7.3](https://github.com/jeedom/plugin-template/actions/workflows/lint_Php73.yml/badge.svg?branch=master)
![PHP 7.4](https://github.com/jeedom/plugin-template/actions/workflows/lint_Php74.yml/badge.svg?branch=master)

Validation Code int (branche MASTER):

![PHP](https://github.com/jeedom/plugin-template/actions/workflows/php.yml/badge.svg?branch=master)
![PHP](https://github.com/jeedom/plugin-template/actions/workflows/codeLintGlobal.yml/badge.svg?branch=master)

Ce "template de plugin" sert de base à la réalisation de plugins pour **Jeedom**.

La documentation générale relative à la conception de plugin est consultable [ici](https://doc.jeedom.com/fr_FR/dev/). Dans le détail :
Expand All @@ -10,7 +35,57 @@ La documentation générale relative à la conception de plugin est consultable
* [Documentation du plugin](https://doc.jeedom.com/fr_FR/dev/documentation_plugin) : Présentation de la mise en place d'une documentation car un bon plugin n'est rien sans documentation adéquate.
* [Publication du plugin](https://doc.jeedom.com/fr_FR/dev/publication_plugin) : Description des pré-requis indispensables à la publication du plugin.

---

### Automatic Linter

Si vous créez une branch nommée prettier, le robot workflows fera une passe complete sur le code pour que le code soit le plus uniforme possible.
---
test workflow en cours... for commit

## Semantic Release

### Description

Ce projet suit la convention [Semantic Release](https://semantic-release.gitbook.io/semantic-release/) pour les messages de commit.
Ceci afin de générer automatiquement le changelog et les versions. Le ChangeLog
doit être dans docs/fr_FR/changelog.md (et docs/fr_FR/changelog_beta.md pour
la branche beta) ; et le numéro de version du plugin sera mis à jour
dans le fichier plugin_info/info.json

### Format de message de commit

Le format général est le suivant ([suivant la norme Angular](https://github.com/angular/angular/blob/main/CONTRIBUTING.md#-commit-message-format)).
Seul le header est obligatoire, les lignes blanches sont également obligatoires pour séparer body et footer s'il y en a.
```
header

(body)

(footer)
```

### Header
```
<type>(<scope>): <short summary>
│ │ │
│ │ └─⫸ un résumé, sans majuscule, sans point
│ │
│ └─⫸ Commit Scope: facultatif
└─⫸ Commit Type: feat|fix|build|ci|docs|perf|refactor|test
```

Le scope est facultatif. Exemple minimal :
```
fix: corrige le bug du pixel
```

Parmi les types, certains ont une influence sur le calcul du numéro de version:
* fix: un fix incrémente un numéro de patch
* feat: une nouvelle fonction incrémente le numéro `mineur`
* les autres types n'ont pas d'incidence sur le numéro de version

### Footer

C'est le footer qui indique s'il y a un `BREAKING CHANGE` donnant lieu à une nouvelle version (numéro majeur incrémenté). La syntaxe du footer dans ce cas est la suivante (le mot-clé `BREAKING CHANGE` est obligatoire):
```
BREAKING CHANGE: description du changement majeur
```