Release Plugin #1
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
name: Release Plugin | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
#extensions: mbstring, intl, zip | |
- name: Install Composer dependencies | |
run: composer install --no-dev --optimize-autoloader | |
- name: Zip project | |
run: zip -r plugin-name.zip . -x '*.git*' 'vendor/*' | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./plugin-name.zip | |
asset_name: plugin-name.zip | |
asset_content_type: application/zip | |
# - name: Submit to WordPress Plugin Store | |
# env: | |
# WORDPRESS_USERNAME: ${{ secrets.WORDPRESS_USERNAME }} | |
# WORDPRESS_PASSWORD: ${{ secrets.WORDPRESS_PASSWORD }} | |
# run: | | |
# curl -u $WORDPRESS_USERNAME:$WORDPRESS_PASSWORD \ | |
# -F 'plugin_name=plugin-name' \ | |
# -F 'zip_file=@plugin-name.zip' \ | |
# https://api.wordpress.org/plugins/add |