Working version with documentation #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Tool to Packagist | |
on: | |
pull_request: | |
branches: | |
- main | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
laravel-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
extensions: mbstring, pdo, pdo_mysql | |
- name: Install PHP dependencies | |
run: composer install --prefer-dist --no-progress --no-suggest | |
- name: Install Node dependencies | |
run: npm install | |
- name: Run SonarQube Scan | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
sonar-scanner | |
- name: Run tests | |
run: php artisan test | |
- name: Create Release | |
if: success() && github.event_name == 'pull_request' && startsWith(github.ref, 'refs/heads/main') | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Publish to Packagist | |
if: success() && github.event_name == 'pull_request' && startsWith(github.ref, 'refs/heads/main') | |
run: composer publish --non-interactive |