Skip to content

Create Release

Create Release #27

Workflow file for this run

name: Create Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version name for the release'
required: true
default: '1.0.0'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4 # Updated to the latest version supporting Node.js 20
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer
- name: Install Composer dependencies without dev
run: composer install --no-dev
- name: Get version from user input
run: echo "VERSION=${{ github.event.inputs.version || '1.0.0' }}" >> $GITHUB_ENV
- name: Cleanup unnecessary files
run: |
rm -f composer.json composer.lock package.json package-lock.json README.md
- name: Zip the plugin
run: |
zip -r sm-post-connector-package.zip . -x "*.git*" -x "*.github*" -x "*.yml" -x "phpunit.xml" -x "tests/**"
- name: Create Release
id: create_release
uses: actions/create-release@v1 # Using the latest available stable version
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
with:
tag_name: v${{ env.VERSION }}
release_name: SM Plugin v${{ env.VERSION }}
body: "Initial release of the SM Plugin plugin."
draft: false
prerelease: false
- name: Upload to Release
uses: actions/upload-release-asset@v1 # Using the latest available stable version
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./sm-post-connector-package.zip
asset_name: sm-post-connector-package.zip
asset_content_type: application/zip