Create a new release PR #55
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
# This workflow allows for the creation of a new release through the GitHub UI. | |
# This is done by creating a pull request to the protected stable release branch. | |
# From there, the publish-release.yml workflow will take over and publish the release. | |
name: Create a new release PR | |
on: | |
workflow_dispatch: | |
inputs: | |
type: | |
type: choice | |
description: The SemVer level of the release | |
options: | |
- patch | |
- minor | |
- major | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
prepare-release: | |
runs-on: ubuntu-latest | |
name: Prepare a new release | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
ref: stable | |
- name: Pull latest changes from master | |
run: | | |
git fetch origin master:master | |
git reset --hard master | |
- name: Remove development dependencies | |
run: | | |
composer remove mockery/mockery --dev --no-install | |
composer remove pestphp/pest --dev --no-install | |
- name: Install dependencies | |
run: composer install --no-interaction --no-progress --no-suggest --prefer-dist | |
- name: Bump application version | |
id: build-version | |
run: | | |
php ./bin/bump-application-version.php ${{ github.event.inputs.type }} | |
echo "version=$(php ./bin/get-release-version.php)" >> $GITHUB_OUTPUT | |
echo "Version: v$(php ./bin/get-release-version.php)" | |
- name: Build executable | |
run: php hyde standalone:build --build-version-suffix="${{ steps.build-version.outputs.sha_short }}" | |
- name: Verify executable | |
run: php builds/hyde | |
- name: Verify executable version | |
run: php builds/hyde --version | |
- name: Upload executable artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: hyde | |
path: builds/hyde | |
- name: Reset Composer file changes | |
run: git restore composer.json composer.lock | |
- name: Create pull request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
commit-message: "HydeCLI v${{ steps.build-version.outputs.version }}" | |
title: "HydeCLI v${{ steps.build-version.outputs.version }}" | |
branch: "release/v${{ steps.build-version.outputs.version }}" | |
delete-branch: true | |
add-paths: | | |
app/Application.php | |
builds/hyde | |
body: | | |
This pull request was automatically created by the [HydeCLI release workflow](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}). | |
Please review and merge it to publish a new release, which will be created automatically upon merge. | |
reviewers: caendesilva | |
labels: release |