Release #40
This file contains hidden or 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: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version to release (X.X.X)' | |
required: true | |
permissions: | |
contents: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
name: Release ${{ inputs.version }} | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Remove optional "v" prefix | |
id: version | |
run: | | |
echo "version=${VERSION#v}" >> "$GITHUB_OUTPUT" | |
env: | |
VERSION: ${{ inputs.version }} | |
- name: Install NPM dependencies | |
run: npm ci | |
- name: Install Composer dependencies | |
run: composer install --prefer-dist --no-interaction --no-progress | |
- name: Build assets | |
run: npm run build | |
- name: Commit assets | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "Assets" | |
file_pattern: dist | |
- name: Update SharpInternalServiceProvider.php version | |
run: sed -i "s/const VERSION = '.*';/const VERSION = '${{ steps.version.outputs.version }}';/g" src/SharpInternalServiceProvider.php | |
- name: Commit version change | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "Update version to v${{ steps.version.outputs.version }}" | |
file_pattern: src/SharpInternalServiceProvider.php | |
tagging_message: "v${{ steps.version.outputs.version }}" | |
- name: Ping forge to start deploy | |
run: curl https://forge.laravel.com/servers/503638/sites/1462752/deploy/http?token=${{ secrets.FORGE_DEPLOY_TOKEN }} |