Skip to content

Commit

Permalink
docs(*): Prepare release 0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
julienloizelet committed Feb 7, 2023
1 parent 66a8e04 commit cfdba98
Show file tree
Hide file tree
Showing 7 changed files with 198 additions and 3 deletions.
22 changes: 22 additions & 0 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

if [ -z "$1" ]; then
echo "Missing argument (commit message). Did you try to run this manually?"
exit 1
fi

commitTitle="$(cat $1 | head -n1)"

# ignore merge
if echo "$commitTitle" | grep -qE "^Merge"; then
echo "Commit hook: ignoring merge"
exit 0
fi

# check commit message
REGEX='^(feat|fix|docs|style|refactor|ci|test|chore|comment)\(.*\)\:.*'
if ! echo "$commitTitle" | grep -qE ${REGEX}; then
echo "Your commit title '$commitTitle' did not follow conventional commit message rules:"
echo "Please comply with the regex ${REGEX}"
exit 1
fi
44 changes: 44 additions & 0 deletions .github/workflows/markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
on:
workflow_dispatch:

name: Markdown files test and update

permissions:
contents: write
pull-requests: write

jobs:
markdown-test-and-update:
name: Markdown files test and update
runs-on: ubuntu-latest
steps:

- name: Clone sources
uses: actions/checkout@v3
with:
path: extension

- name: Launch localhost server
run: |
sudo npm install --global http-server
http-server ./extension &
- name: Set up Ruby 2.6
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

- name: Check links in Markdown files
run: |
gem install awesome_bot
cd extension
awesome_bot --files README.md --allow-dupe --allow 401 --skip-save-results --white-list ddev.site --base-url http://localhost:8080/
- name: Generate table of contents
uses: technote-space/toc-generator@v4
with:
MAX_HEADER_LEVEL: 5
COMMIT_NAME: Okaeli Dev Bot
TARGET_PATHS: 'docs/*.md'
CHECK_ONLY_DEFAULT_BRANCH: true
CREATE_PR: true
106 changes: 106 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Create Release
# example: gh workflow run release.yml -f tag_name=v1.1.4 -f draft=true
on:
workflow_dispatch:
branches:
- main
inputs:
tag_name:
type: string
required: true
draft:
type: boolean
description: Draft release
default: false
prerelease:
type: boolean
description: Prerelease
default: false
first-release:
type: boolean
description: First release
default: false

jobs:
prepare-release:
name: Prepare release
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Check naming convention
run: |
VERIF=$(echo ${{ github.event.inputs.tag_name }} | grep -E "^v([0-9]{1,}\.)([0-9]{1,}\.)([0-9]{1,})(-(alpha|beta)\.[0-9]{1,})?$")
if [ ! ${VERIF} ]
then
echo "Tag name '${{ github.event.inputs.tag_name }}' does not comply with naming convention vX.Y.Z"
exit 1
fi
- name: Set version number without v
run: |
echo "VERSION_NUMBER=$(echo ${{ github.event.inputs.tag_name }} | sed 's/v//g' )" >> $GITHUB_ENV
- name: Clone sources
uses: actions/checkout@v3

- name: Check version ${{ env.VERSION_NUMBER }} consistency in files
# Check CHANGELOG.md
run: |
# Check top ## [VERSION_NUMBER](GITHUB_URL/releases/tag/vVERSION_NUMBER) - yyyy-mm-dd in CHANGELOG.md
CURRENT_DATE=$(date +'%Y-%m-%d')
echo $CURRENT_DATE
CHANGELOG_VERSION=$(grep -o -E "## \[(.*)\].* - $CURRENT_DATE" CHANGELOG.md | head -1 | sed 's/ //g')
echo $CHANGELOG_VERSION
if [[ $CHANGELOG_VERSION == "##[${{ env.VERSION_NUMBER }}]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/tag/v${{ env.VERSION_NUMBER }})-$CURRENT_DATE" ]]
then
echo "CHANGELOG VERSION OK"
else
echo "CHANGELOG VERSION KO"
exit 1
fi
# Check top [_Compare with previous release_](GITHUB_URL/compare/vLAST_TAG...vVERSION_NUMBER) in CHANGELOG.md
if [[ ${{ github.event.inputs.first-release }} != "true" ]]
then
COMPARISON=$(grep -oP "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/compare/\K(.*)$" CHANGELOG.md | head -1)
LAST_TAG=$(curl -Ls -o /dev/null -w %{url_effective} $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/latest | grep -oP "\/tag\/\K(.*)$")
if [[ $COMPARISON == "$LAST_TAG...v${{ env.VERSION_NUMBER }})" ]]
then
echo "VERSION COMPARISON OK"
else
echo "VERSION COMPARISON KO"
echo $COMPARISON
echo "$LAST_TAG...v${{ env.VERSION_NUMBER }})"
exit 1
fi
fi
- name: Create Tag ${{ github.event.inputs.tag_name }}
uses: actions/github-script@v6
with:
github-token: ${{ github.token }}
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ github.event.inputs.tag_name }}",
sha: context.sha
})
- name: Prepare release notes
run: |
# Retrieve release body and remove ---
VERSION_RELEASE_NOTES=$(awk -v ver="[${{ env.VERSION_NUMBER }}]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/tag/v${{ env.VERSION_NUMBER }})" '/^## / { if (p) { exit }; if ($2 == ver) { p=1; next} } p && NF' CHANGELOG.md | sed ':a;N;$!ba;s/\n---/ /g')
echo "$VERSION_RELEASE_NOTES" >> CHANGELOG.txt
- name: Create release ${{ env.VERSION_NUMBER }}
uses: softprops/action-gh-release@v1
with:
body_path: CHANGELOG.txt
name: ${{ env.VERSION_NUMBER }}
tag_name: ${{ github.event.inputs.tag_name }}
draft: ${{ github.event.inputs.draft }}
prerelease: ${{ github.event.inputs.prerelease }}
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Public API

The purpose of this section is to declare the public API of this project as required by [item 1 of semantic versioning specification](https://semver.org/spec/v2.0.0.html#spec-item-1).

The public API for this project is defined by the files `docker-compose.playwright.yaml` and `install.yaml`.

---


## [0.0.1](https://github.com/julienloizelet/ddev-playwright/releases/tag/v0.0.1) - 2023-02-07
### Added
- Initial release

10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
[![tests](https://github.com/drud/ddev-playwright/actions/workflows/tests.yml/badge.svg)](https://github.com/drud/ddev-playwright/actions/workflows/tests.yml) ![project is maintained](https://img.shields.io/maintenance/yes/2022.svg)
[![tests](https://github.com/julienloizelet/ddev-playwright/actions/workflows/tests.yml/badge.svg)](https://github.
com/drud/ddev-playwright/actions/workflows/tests.yml) ![project is maintained](https://img.shields.io/maintenance/yes/2023.svg)

# ddev-playwright <!-- omit in toc -->
# ddev-playwright

* [What is ddev-playwright?](#what-is-ddev-playwright)
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## What is ddev-playwright?

Expand Down
Binary file removed images/template-button.png
Binary file not shown.
Empty file removed tests/testdata/.gitmanaged
Empty file.

0 comments on commit cfdba98

Please sign in to comment.