Skip to content

Commit

Permalink
Merge branch 'main' into lengow-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-hours committed Sep 3, 2024
2 parents a070437 + a908fe2 commit 5f621b7
Show file tree
Hide file tree
Showing 14 changed files with 464 additions and 541 deletions.
10 changes: 10 additions & 0 deletions .github/conventional-commit-checker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
IFS=$'\n'
for log in $(git log origin/main..$(git branch --show-current) --format='%s'); do
echo $log | grep -P '^(?P<type>[a-z]+)(\((?P<scope>[a-z-]+)\))?(?P<breaking>!)?: (\[(?P<ticket>[A-Z0-9-]+)\] )?(?P<message>[^\n]+)(\n\n(?P<infos>.+))?$' >/dev/null
if [ $? -eq 1 ]; then
echo -e "The following log don't follow Conventionnal commits:\n\t$log"
exit 1
fi
done
unset IFS
19 changes: 19 additions & 0 deletions .github/reviewers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
reviewers:
defaults:
- repository-owners
groups:
repository-owners:
- team:E-commerce-Plugins
devops:
- team:Platform

files:
'**':
- repository-owners
'.github/**':
- devops

options:
number_of_reviewers: 2
ignore_draft: true
enable_group_assignment: true
17 changes: 17 additions & 0 deletions .github/workflows/auto-assign-reviewer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Auto Request Review

on:
- pull_request

jobs:
auto-request-review:
name: Assign Reviewers
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Request review based on files changes and/or groups the author belongs to
uses: necojackarc/[email protected]
with:
token: ${{ secrets.AUTO_ASSIGN_REVIEWERS }}
config: .github/reviewers.yml
34 changes: 34 additions & 0 deletions .github/workflows/on-pull-request-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Run Tests

on:
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
- ready_for_review

env:
PROJECT_NAME: ${{ github.event.repository.name }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

jobs:
check-commits:
name: Check Commits Syntax
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Check commits
shell: bash
continue-on-error: true
run: |
/bin/bash .github/conventional-commit-checker.sh
# TODO: Unit-tests
62 changes: 62 additions & 0 deletions .github/workflows/on-push-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Release

on:
pull_request:
branches:
- main
types: [closed]

permissions:
contents: write
pull-requests: write

env:
PROJECT_NAME: ${{ github.event.repository.name }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

jobs:
get-next-version:
name: Determine Next Version
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.merged }}
outputs:
next-version: ${{ steps.semver.outputs.next || steps.semver.outputs.current }}
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get next version
id: semver
uses: ietf-tools/semver-action@main
with:
token: ${{ github.token }}
patchList: fix, refactor, misc
noVersionBumpBehavior: current
noNewCommitBehavior: current

release-please:
name: Create a Release and a version tag
needs: [get-next-version]
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.merged }}
outputs:
image-tag: ${{ steps.release-please.outputs.tag_name }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Release please
uses: google-github-actions/release-please-action@v3
id: release-please
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: php
package-name: plugin-woocommerce
default-branch: main
changelog-types: |
[
{"type":"feat","section":"Features","hidden":false},
{"type":"fix","section":"Bug Fixes","hidden":false},
{"type":"refactor","section":"Refactoring","hidden":false},
{"type":"misc","section":"Miscellaneous","hidden":false}
]
2 changes: 2 additions & 0 deletions CHANGELOG → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Changelog

========================================================
Version 2.6.3
========================================================
Expand Down
4 changes: 0 additions & 4 deletions Jenkinsfile

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- **Requires at least:** 5.3
- **Tested up to:** 6.5
- **Requires PHP:** 5.5
- **Stable tag:** 2.6.3
- **Stable tag:** 2.6.4
- **License:** GPLv3
- **License URI:** https://www.gnu.org/licenses/gpl-3.0

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "lengow/lengow-woocommerce",
"version": "2.6.4",
"description": "Lengow is the e-commerce automation solution that helps brands and distributors improve their performance, automate their business processes, and grow internationally.",
"keywords": ["wordpress", "plugin", "lengow"],
"homepage": "https://www.lengow.com",
Expand Down
Loading

0 comments on commit 5f621b7

Please sign in to comment.