Skip to content

Commit

Permalink
ci(semantic-release): install and configure semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
nelson6e65 committed Mar 14, 2021
1 parent b4f7e97 commit c177c9e
Show file tree
Hide file tree
Showing 4 changed files with 14,619 additions and 3,352 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Release
on:
push:
branches:
- main
jobs:
release:
name: Release
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

# PHP --------------------------------------------------------------------
- name: Setup PHP 7.4 environment
uses: nanasess/setup-php@v3.0.6
with:
php-version: 7.4

- name: Validate composer.json and composer.lock
run: composer validate

- name: Get Composer cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Composer (cache)
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Linting PHP code
run: composer cs:php

# npm --------------------------------------------------------------------
- name: Setup Node.js environment
uses: actions/setup-node@v2.1.2
with:
node-version: '12'

- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: NPM (cache)
uses: actions/cache@v2
id: npm-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Node.js dependencies
run: npm install

- name: Linting general code
run: npm run cs:lint

- name: Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: npx semantic-release
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# PHP Code Sniffer Helpers

[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![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)
![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/nelson6e65/code-sniffer-helpers)

[![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)
Expand Down
Loading

0 comments on commit c177c9e

Please # to comment.