Skip to content

Commit

Permalink
ci: add semantic-release (#534)
Browse files Browse the repository at this point in the history
* ci: add semantic-release

* dont run tests on pushes

* rename file

* fix lint job not running?

* fix pull_request_target usage

* fix yml

* fix lint

* switch it back

* fix lint

* fix job
  • Loading branch information
bytestream committed Nov 22, 2020
1 parent 8010f83 commit 44e6776
Show file tree
Hide file tree
Showing 9 changed files with 8,748 additions and 3,227 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/.hound.yml export-ignore
/.javascript-style.json export-ignore
/.jshintignore export-ignore
/.releaserc export-ignore
/.scrutinizer.yml export-ignore
/.styleci.yml export-ignore
/CODE_OF_CONDUCT.md export-ignore
Expand All @@ -16,7 +17,6 @@
/package.json export-ignore
/package-lock.json export-ignore
/phpunit.xml.dist export-ignore
/.scrutinizer.yml export-ignore
/tests export-ignore

# Don't check generated files in github language statistics
Expand Down
29 changes: 29 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "fix"
prefix-development: "chore"
include: "scope"

- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "fix"
prefix-development: "chore"
include: "scope"

- package-ecosystem: composer
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "fix"
prefix-development: "chore"
include: "scope"
17 changes: 17 additions & 0 deletions .github/workflows/lint-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copied from https://github.com/amannn/action-semantic-pull-request/blob/master/.github/workflows/lint-pr-title.yml
name: 'Lint PR title'

on:
pull_request:
types:
- opened
- edited
- synchronize

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v1.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: release

on:
push:
branches:
- master

env:
NODE_VERSION: 12

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v2.1.2
with:
node-version: ${{ env.NODE_VERSION }}

# full checkout for semantic-release
- uses: actions/checkout@v2.3.3
with:
fetch-depth: 0

# Cache npm packages.
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Installing dependencies
run: npm install

- name: semantic-release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GIT_AUTHOR_NAME: semantic-release-bot
GIT_AUTHOR_EMAIL: semantic-release-bot
GIT_COMMITTER_NAME: semantic-release-bot
GIT_COMMITTER_EMAIL: semantic-release-bot
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: tests

on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'
Expand Down
70 changes: 70 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
["@semantic-release/release-notes-generator", {
"linkCompare": false,
"linkReferences": false
}],
["@semantic-release/exec", {
"prepareCmd": "gulp build",
}],
["@semantic-release/git", {
"assets": ["public/**/*"],
"message": "chore(release): ${nextRelease.version} [skip ci]"
}]
"@semantic-release/github"
],
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "feature",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "perf",
"section": "Performance Improvements"
},
{
"type": "revert",
"section": "Reverts"
},
{
"type": "docs",
"section": "Documentation"
},
{
"type": "style",
"section": "Styles"
},
{
"type": "chore",
"section": "Miscellaneous Chores"
},
{
"type": "refactor",
"section": "Code Refactoring"
},
{
"type": "test",
"section": "Tests"
},
{
"type": "build",
"section": "Build System"
},
{
"type": "ci",
"section": "Continuous Integration"
}
]
},
}
Loading

0 comments on commit 44e6776

Please sign in to comment.