Skip to content

Create release for 4.13.0 #225

Create release for 4.13.0

Create release for 4.13.0 #225

name: Create Release
run-name: Create release for ${{ github.event.client_payload.version }}
on:
repository_dispatch:
types:
- craftcms/new-release
env:
PROJECT_DIRECTORY: 'craftcms'
BUNDLE_ZIP_FILENAME: 'CraftCMS-${{ github.event.client_payload.version }}.zip'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: 'Set up PHP for Craft 3'
uses: shivammathur/[email protected]
if: ${{ startsWith(github.event.client_payload.version, '3.') }}
with:
extensions: bcmath, curl, dom, json, intl, mbstring, mcrypt, openssl, pcre, pdo, zip
php-version: 7.2.5
tools: composer:v2
- name: 'Set up PHP for Craft 4'
uses: shivammathur/[email protected]
if: ${{ startsWith(github.event.client_payload.version, '4.') }}
with:
extensions: bcmath, curl, dom, json, intl, mbstring, mcrypt, openssl, pcre, pdo, zip
php-version: 8.2.0
tools: composer:v2
- name: 'Set up PHP for Craft 5'
uses: shivammathur/[email protected]
if: ${{ startsWith(github.event.client_payload.version, '5.') }}
with:
extensions: bcmath, curl, dom, json, intl, mbstring, mcrypt, openssl, pcre, pdo, zip
php-version: 8.2.0
tools: composer:v2
- name: 'Initialize Craft 3 starter project'
if: ${{ startsWith(github.event.client_payload.version, '3.') }}
run: 'composer create-project craftcms/craft:^3 ${{ env.PROJECT_DIRECTORY }}'
- name: 'Initialize Craft 4 starter project'
if: ${{ startsWith(github.event.client_payload.version, '4.') }}
run: 'composer create-project craftcms/craft:^4 --no-scripts ${{ env.PROJECT_DIRECTORY }}'
- name: 'Initialize Craft 5 starter project'
if: ${{ startsWith(github.event.client_payload.version, '5.') }}
run: 'composer create-project craftcms/craft:^5 --no-scripts ${{ env.PROJECT_DIRECTORY }}'
- name: 'Replace composer.json with composer.json.default'
working-directory: ${{ env.PROJECT_DIRECTORY }}
run: 'rm composer.json && mv composer.json.default composer.json'
- name: 'Install specific Craft version'
working-directory: ${{ env.PROJECT_DIRECTORY }}
run: 'composer require craftcms/cms:${{ github.event.client_payload.version }} --update-with-dependencies'
- name: 'Update Craft 3 .env'
if: ${{ startsWith(github.event.client_payload.version, '3.') }}
working-directory: ${{ env.PROJECT_DIRECTORY }}
run: |
sed -i 's/SECURITY_KEY=.*/SECURITY_KEY=/g' .env
sed -i 's/APP_ID=.*/APP_ID=/g' .env
- name: 'Create zip'
working-directory: ${{ env.PROJECT_DIRECTORY }}
run: 'zip -r ../${{ env.BUNDLE_ZIP_FILENAME }} ./'
- name: 'Create release'
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: ${{ env.BUNDLE_ZIP_FILENAME }}
body: ${{ github.event.client_payload.notes }}
makeLatest: ${{ github.event.client_payload.latest }}
name: ${{ github.event.client_payload.version }}
prerelease: ${{ github.event.client_payload.prerelease }}
tag: ${{ github.event.client_payload.tag }}