diff --git a/dependabot.yml b/.github/dependabot.yml similarity index 100% rename from dependabot.yml rename to .github/dependabot.yml diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 423ac3a..19f47ab 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -1,6 +1,6 @@ name: phpstan -on: [ push, pull_request ] +on: [push, pull_request] jobs: analyze: @@ -9,28 +9,29 @@ jobs: name: PHPStan steps: - - uses: actions/checkout@v4 + - name: ๐Ÿ— Checkout code + uses: actions/checkout@v4 - - name: Setup PHP + - name: ๐Ÿ— Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: "8.3" coverage: none tools: phpstan - - name: Get composer cache directory + - name: ๐Ÿ— Get composer cache directory id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - name: Cache dependencies - uses: actions/cache@v3 + - name: ๐Ÿ— Cache dependencies + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: phpstan-composer-${{ hashFiles('**/composer.lock') }} restore-keys: phpstan-composer- - - name: Install dependencies + - name: ๐Ÿ“ฆ Install dependencies run: composer install --no-interaction --no-suggest - - name: Run analysis + - name: ๐Ÿงช Analyse code run: phpstan analyse diff --git a/.github/workflows/pint.yml b/.github/workflows/pint.yml index 7fcce08..2727469 100644 --- a/.github/workflows/pint.yml +++ b/.github/workflows/pint.yml @@ -1,6 +1,6 @@ name: pint -on: [ push, pull_request ] +on: [push, pull_request] jobs: analyze: @@ -9,14 +9,15 @@ jobs: name: Laravel Pint steps: - - uses: actions/checkout@v4 + - name: ๐Ÿ— Checkout code + uses: actions/checkout@v4 - - name: Setup PHP + - name: ๐Ÿ— Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: "8.3" coverage: none tools: laravel/pint - - name: Run analysis + - name: ๐Ÿงช Analyse code run: pint diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b8d0dfc..e3f94d5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,24 +3,50 @@ name: Publish on: push: tags: - - '**' + - "**" jobs: + # @see https://stackoverflow.com/a/72959712/8179249 + check-current-branch: + runs-on: ubuntu-latest + + outputs: + branch: ${{ steps.check_step.outputs.branch }} + + steps: + - name: ๐Ÿ— Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: ๐Ÿ— Get current branch + id: check_step + run: | + raw=$(git branch -r --contains ${{ github.ref }}) + branch="$(echo ${raw//origin\//} | tr -d '\n')" + echo "{name}=branch" >> $GITHUB_OUTPUT + echo "Branches where this tag exists : $branch." + build: runs-on: ubuntu-latest + + needs: check-current-branch + steps: - - uses: actions/checkout@v4 + - name: ๐Ÿ— Checkout code + uses: actions/checkout@v4 - - name: Get release info + - name: ๐Ÿ— Get release info id: query-release-info - uses: release-flow/keep-a-changelog-action@v2 + uses: release-flow/keep-a-changelog-action@v3 with: command: query version: latest - - name: Publish to Github releases - uses: softprops/action-gh-release@v1 + - name: ๐Ÿš€ Publish to Github releases + uses: softprops/action-gh-release@v2 with: body: ${{ steps.query-release-info.outputs.release-notes }} + make_latest: contains(${{ needs.check.outputs.branch }}, 'main') # prerelease: true # files: '*.vsix' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0b80bf6..b949569 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,6 @@ name: tests -on: [ push, pull_request ] +on: [push, pull_request] jobs: test: @@ -9,56 +9,64 @@ jobs: strategy: fail-fast: true matrix: - os: [ ubuntu-latest ] - php: [ 8.1, 8.2, 8.3 ] - laravel: [ 9.*, 10.* ] - dependency-version: [ prefer-stable ] + os: [ubuntu-latest] + php: [8.0, 8.1, 8.2, 8.3] + stability: [prefer-stable] + laravel: [9.*, 10.*, 11.*] include: - laravel: 9.* testbench: 7.* - laravel: 10.* testbench: 8.* + + - laravel: 11.* + testbench: 9.* exclude: - - laravel: 10.* - php: 8.0 + - php: 8.0 + laravel: 10.* + + - php: 8.0 + laravel: 11.* + + - php: 8.1 + laravel: 11.* - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} steps: - - name: Checkout code + - name: ๐Ÿ— Checkout code uses: actions/checkout@v4 - - name: Setup PHP + - name: ๐Ÿ— Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: dom, curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, intl, exif coverage: pcov - - name: Get composer cache directory + - name: ๐Ÿ— Get composer cache directory id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - name: Cache dependencies - uses: actions/cache@v3 + - name: ๐Ÿ— Cache dependencies + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer-${{ matrix.dependency-version }}- + key: dependencies-composer-laravel-${{ matrix.laravel }}-${{ hashFiles('**/composer.lock') }} + restore-keys: dependencies-composer-laravel-${{ matrix.laravel }}- - - name: Install dependencies + - name: ๐Ÿ“ฆ Install dependencies run: | composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update - composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest + composer update --prefer-dist --no-interaction --no-progress --${{ matrix.stability }} - - name: Execute tests + - name: ๐Ÿงช Execute tests run: vendor/bin/phpunit -c phpunit.coverage.dist.xml - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 + - name: ๐Ÿš€ Upload coverage reports to Codecov + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} files: ./clover.xml fail_ci_if_error: true - verbose: true + # verbose: true diff --git a/composer.json b/composer.json index 875c2fc..d152522 100644 --- a/composer.json +++ b/composer.json @@ -1,61 +1,62 @@ { - "name": "open-southeners/carbone-sdk", - "description": "Unofficial port of the Carbone API SDK to Saloon v3", - "license": "MIT", - "keywords": [ - "open-southeners", - "carbone", - "carbone-sdk", - "carbone-client", - "carbone-api", - "word", - "excel", - "office", - "pdf", - "generator" - ], - "authors": [ - { - "name": "Ruben Robles", - "email": "me@d8vjork.com", - "homepage": "https://d8vjork.com" - } - ], - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/open-southeners" - } - ], - "require": { - "php": "^8.0", - "saloonphp/saloon": "^3.0" - }, - "require-dev": { - "orchestra/testbench": "^7.0 || ^8.0", - "phpstan/phpstan": "^1.0", - "phpunit/phpunit": "^9.0 || ^10.0", - "tomasvotruba/type-coverage": "^0.2" - }, - "minimum-stability": "dev", - "autoload": { - "psr-4": { - "OpenSoutheners\\CarboneSdk\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "OpenSoutheners\\CarboneSdk\\Tests\\": "tests" - } - }, - "config": { - "sort-packages": true - }, - "extra": { - "laravel": { - "providers": [ - "OpenSoutheners\\CarboneSdk\\ServiceProvider" - ] - } + "name": "open-southeners/carbone-sdk", + "description": "Unofficial port of the Carbone API SDK to Saloon v3", + "license": "MIT", + "keywords": [ + "open-southeners", + "carbone", + "carbone-sdk", + "carbone-client", + "carbone-api", + "word", + "excel", + "office", + "pdf", + "generator" + ], + "authors": [ + { + "name": "Ruben Robles", + "email": "me@d8vjork.com", + "homepage": "https://d8vjork.com" } -} \ No newline at end of file + ], + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/open-southeners" + } + ], + "require": { + "php": "^8.0", + "saloonphp/saloon": "^3.0" + }, + "require-dev": { + "orchestra/testbench": "^7.0 || ^8.0 || ^9.0", + "phpstan/phpstan": "^1.0", + "phpunit/phpunit": "^9.0 || ^10.0", + "tomasvotruba/type-coverage": "^0.2" + }, + "minimum-stability": "stable", + "prefer-stable": true, + "autoload": { + "psr-4": { + "OpenSoutheners\\CarboneSdk\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "OpenSoutheners\\CarboneSdk\\Tests\\": "tests" + } + }, + "config": { + "sort-packages": true + }, + "extra": { + "laravel": { + "providers": [ + "OpenSoutheners\\CarboneSdk\\ServiceProvider" + ] + } + } +}