Skip to content

Commit

Permalink
feat: added semantic-release to repository
Browse files Browse the repository at this point in the history
  • Loading branch information
paales committed Jun 3, 2020
1 parent d063bb8 commit e676ced
Show file tree
Hide file tree
Showing 5 changed files with 5,603 additions and 5 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release
on:
push:
branches:
- master
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: yarn --frozen-lockfile
- run: yarn semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

This comment has been minimized.

Copy link
@paales

paales Jun 3, 2020

Author Member

We create a GitHub action that will start the semantic-release process. Make sure the SLACK_WEBHOOK is available in the project. There is a global SLACK_WEBHOOK available that can be added to any project that will post to #announcements.

To post the release notes to a specific channel, see https://github.com/juliuscc/semantic-release-slack-bot#slack-app-installation

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
.idea

/vendor/
/node_modules/
yarn-error.log
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,20 @@ penalties.

## Reasoning

Docker is easy, docker scales, we love docker, but docker's volume mounting is
Docker is easy, docker scales, we love Docker, but docker's volume mounting is
slow, we can't have slow.

The problem with all the docker devboxes is that they require running php inside
a vm. The problem with php in a vm is that files need to be available in the vm,
but it also also need to have files outside the vm, because programs like
a vm. The problem with php in a VM is that files need to be available in the VM,
but it also needs to have files outside the VM, because programs like
PHPStorm and others do not accept network drives.

Sync is slower than no sync. [docker-sync](http://docker-sync.io/),
[nfs](https://docs.docker.com/v17.12/datacenter/dtr/2.1/guides/configure/use-nfs/),
[unison](https://www.cis.upenn.edu/~bcpierce/unison/),
[mutagen](https://mutagen.io/) offer good sync solutions, but always slower than
no sync.

Also syncs require additional HDD space and additional mental overhead: Are my
Hovever, syncs require additional HDD space and additional mental overhead: Are my
files synced?, Is my sync broken? Are there sync conflicts? Why did that file
appear here? Where should I execute my php cli scripts? Where should I run node
cli? Why is my system slow? Sync is bad.
Expand Down Expand Up @@ -244,3 +243,10 @@ configuration file there.
## How do I restart php-fpm?

`pkill php-fpm`

## Commits

Commits are validated with https://github.com/conventional-changelog/commitlint

Gittower: Gittower doesn't properly read your PATH variable and thus commit
validation doesn't work. Use `gittower .` to open this repo.

This comment has been minimized.

Copy link
@paales

paales Jun 3, 2020

Author Member

Add a note to the README how a developer should startup Tower.

96 changes: 96 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"name": "@reachdigital/docker-devbox",
"version": "1.0.0-preview.1",
"description": "🐳 Reach Digital Magento 2 Docker+local hybrid devbox 🐳",
"repository": "[email protected]:ho-nl/docker-development-box.git",
"author": "Paul Hachmang <[email protected]>",
"license": "MIT",
"private": true,

This comment has been minimized.

Copy link
@paales

paales Jun 3, 2020

Author Member

Repository is private, prevents it from being published to npm.

"scripts": {
"semantic-release": "semantic-release"
},
"devDependencies": {
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"@semantic-release/git": "^9.0.0",
"husky": "^4.2.5",
"semantic-release": "^17.0.8",
"semantic-release-slack-bot": "^1.6.2"
},

This comment has been minimized.

Copy link
@paales

paales Jun 3, 2020

Author Member
yarn add -D @commitlint/cli @commitlint/config-conventional @semantic-release/git husky semantic-release semantic-release-slack-bot
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"

This comment has been minimized.

Copy link
@paales

paales Jun 3, 2020

Author Member

All commits are validated with commitlint: https://github.com/conventional-changelog/commitlint#what-is-commitlint

The actual commit types determine the actual releases made and what gets put in the release notes

}
},
"release": {
"plugins": [
"@semantic-release/commit-analyzer",
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{
"type": "docs",
"section": "Documentation"
},
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Fixes"
},
{
"type": "perf",
"section": "Performance Improvements"
},
{
"type": "build",
"section": "Build"
},
{
"type": "refactor",
"section": "Refactor"
}
]
}
}
],

This comment has been minimized.

Copy link
@paales

paales Jun 3, 2020

Author Member

Only the above types are added to the release notes.

"@semantic-release/npm",

This comment has been minimized.

Copy link
@paales

paales Jun 3, 2020

Author Member

Updates the version in the package.json. For PHP projects this is isn't required.

"@semantic-release/git",

This comment has been minimized.

Copy link
@paales

paales Jun 3, 2020

Author Member

Creates a git tag

"@semantic-release/github",

This comment has been minimized.

Copy link
@paales

paales Jun 3, 2020

Author Member

Creates a release, comments on PR's that they are released.

[
"semantic-release-slack-bot",

This comment has been minimized.

Copy link
@paales

paales Jun 3, 2020

Author Member

Posts notification to Slack, please configure SLACK_WEBHOOK

{
"notifyOnSuccess": true,
"notifyOnFail": true,
"markdownReleaseNotes": true,
"onSuccessTemplate": {
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*New release for $repo_url 🎉*\n$release_notes"
}
}
]
}
}
]
],
"branches": [
{
"name": "master"
}
]
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
}
}
Loading

0 comments on commit e676ced

Please sign in to comment.