michael-rubel / artisan-release-command
Artisan command to create a GitHub release of your code.
Fund package maintenance!
paypal.com/donate/?hosted_button_id=KHLEL8PFS4AXJ
Installs: 1 239
Dependents: 0
Suggesters: 0
Security: 0
Stars: 16
Watchers: 1
Forks: 0
Open Issues: 1
Requires
- php: ^8.1
- illuminate/contracts: ^10.8|^11.0
- spatie/laravel-package-tools: ^1.14
Requires (Dev)
- infection/infection: ^0.27
- larastan/larastan: ^2.0
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.0|^8.0
- orchestra/testbench: ^8.0|^9.0
- phpunit/phpunit: ^10.5
- roave/backward-compatibility-check: ^7.0|^8.0
This package is auto-updated.
Last update: 2024-12-10 01:28:18 UTC
README
Artisan command to create a GitHub release of your code.
Prerequisites
- GitHub Actions
- GitHub CLI
- Access to a version file (Linux permissions).
The package requires PHP 8.1
or higher and Laravel 10.8
or higher.
#StandWithUkraine
Installation
Install the package using composer:
composer require michael-rubel/artisan-release-command --dev
Publish the config if you need to customize the command:
php artisan vendor:publish --tag="artisan-release-command-config"
Usage
Setup the GitHub Actions workflow trigger with the following parameters:
on: push: tags: - '[0-9]+.[0-9]+.[0-9]+'
Or alternatively:
on: release: types: - created
Create a versioning file, for example:
<?php namespace App; abstract class Service { /** * App version. */ final public const VERSION = '0.0.1'; }
Note: the version file should always contain a VERSION
constant for the command to work. You can configure the constant name in the configuration file if you want to name it for example "APP_VERSION"
The command will bump version based on the SemVer 2.0 type you'll provide.
php artisan release {type}
It will pick the latest release you have in the versioning file, bump it a step further and push the change to the remote repository using your current Git setup. Make sure you're authorized to perform basic operations on your repository.
For example:
php artisan release major
Available options: major
, minor
, patch
Default value: patch
After the version is pushed, it will create a release using GitHub CLI and provide auto-generated notes.
Beta release
Creates the pre-release based on the given version type:
php artisan release major --beta
If you had 0.0.1 in your version file, after this command it will be 1.0.0-beta, and the release will be marked as "pre-release" on GitHub (deployment won't be triggered if you use [0-9]+.[0-9]+.[0-9]+
pattern in GitHub Actions).
Testing
composer test
License
The MIT License (MIT). Please see License File for more information.