Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.x] Release action #49838

Merged
merged 4 commits into from
Jan 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: manual release

on:
workflow_dispatch:
inputs:
version:
description: 'Version to release'
required: true

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Remove optional "v" prefix
id: version
run: VERSION=${{ inputs.version }} echo "::set-output name=version::${VERSION#v}"

- name: Update Application.php version
run: |
sed -i "s/const VERSION = '.*';/const VERSION = '${{ steps.version.outputs.version }}';/g" src/Illuminate/Foundation/Application.php
git add src/Illuminate/Foundation/Application.php
git commit -m "Update version to v${{ steps.version.outputs.version }}"
git push origin ${{ github.ref_name }}

- name: SSH into splitter server
uses: appleboy/ssh-action@master
with:
host: 104.248.56.26
username: forge
key: ${{ secrets.SSH_PRIVATE_KEY_SPLITTER }}

- name: Change directory
run: cd laravel-${{ github.ref_name }}

- name: Pull in latest changes
run: git pull origin ${{ github.ref_name }}

- name: Run release script
run: bash bin/release v${{ steps.version.outputs.version }}

- name: Generate Release Notes
id: notes
uses: RedCrafter07/release-notes-action@main
with:
tag-name: v${{ steps.version.outputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref_name }}

- name: Cleanup release notes
run: |
sed -i '/## What\'\''s Changed/q' ${{ steps.notes.outputs.release-notes }}
sed -i '/## Contributors/,$d' ${{ steps.notes.outputs.release-notes }}

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.version.outputs.version }}
release_name: v${{ steps.version.outputs.version }}
body: ${{ steps.notes.outputs.release-notes }}
Loading