Skip to content

Commit c177c9e

Browse files
committed
ci(semantic-release): install and configure semantic-release
1 parent b4f7e97 commit c177c9e

File tree

4 files changed

+14619
-3352
lines changed

4 files changed

+14619
-3352
lines changed

.github/workflows/release.yml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
release:
8+
name: Release
9+
runs-on: ubuntu-18.04
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
16+
# PHP --------------------------------------------------------------------
17+
- name: Setup PHP 7.4 environment
18+
uses: nanasess/setup-php@v3.0.6
19+
with:
20+
php-version: 7.4
21+
22+
- name: Validate composer.json and composer.lock
23+
run: composer validate
24+
25+
- name: Get Composer cache directory
26+
id: composer-cache
27+
run: |
28+
echo "::set-output name=dir::$(composer config cache-files-dir)"
29+
30+
- name: Composer (cache)
31+
uses: actions/cache@v2
32+
with:
33+
path: ${{ steps.composer-cache.outputs.dir }}
34+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
35+
restore-keys: |
36+
${{ runner.os }}-composer-
37+
38+
- name: Install dependencies
39+
run: composer install --prefer-dist --no-progress
40+
41+
- name: Linting PHP code
42+
run: composer cs:php
43+
44+
# npm --------------------------------------------------------------------
45+
- name: Setup Node.js environment
46+
uses: actions/setup-node@v2.1.2
47+
with:
48+
node-version: '12'
49+
50+
- name: Get npm cache directory
51+
id: npm-cache-dir
52+
run: |
53+
echo "::set-output name=dir::$(npm config get cache)"
54+
55+
- name: NPM (cache)
56+
uses: actions/cache@v2
57+
id: npm-cache
58+
with:
59+
path: ${{ steps.npm-cache-dir.outputs.dir }}
60+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
61+
restore-keys: |
62+
${{ runner.os }}-node-
63+
64+
- name: Install Node.js dependencies
65+
run: npm install
66+
67+
- name: Linting general code
68+
run: npm run cs:lint
69+
70+
- name: Release
71+
env:
72+
GITHUB_TOKEN: ${{ github.token }}
73+
run: npx semantic-release

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# PHP Code Sniffer Helpers
22

33
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
4+
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/nelson6e65/code-sniffer-helpers)
45
![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/nelson6e65/code-sniffer-helpers)
56

67
[![GitHub release](https://img.shields.io/github/tag/nelson6e65/php-code-sniffer-helpers.svg?logo=github)](https://github.com/nelson6e65/php-code-sniffer-helpers/tags)

0 commit comments

Comments
 (0)