Skip to content

Initializes at init so that just in time translations dont run too ea… #21

Initializes at init so that just in time translations dont run too ea…

Initializes at init so that just in time translations dont run too ea… #21

Workflow file for this run

name: main
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
- name: Checkout Repo
id: checkout_repo
uses: actions/checkout@v2
# Gets the version from package.json and sets it as an environment variable.
- name: Set Plugin Version
id: set_plugin_version
run: echo "PLUGIN_VERSION=$(grep '* Version:' wpgpt.php | awk '{print $3}')" >> $GITHUB_ENV
# Setup PHP.
- name: Setup PHP
id: setup_php
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.1"
tools: composer:2.4
# Installs production Composer dependencies
- name: Install Composer Production Dependencies
id: install_composer_production_dependencies
run: |
composer install --no-dev
# Zips the plugin.
- name: Zip Plugin
id: zip_plugin
run: |
zip -r wpgpt.zip . -x ".git/*" -x ".vscode/*" -x ".github/*" -x ".editorconfig" -x ".gitignore" -x "composer.json" -x "composer.lock" -x "phpcs.xml" -x "pre-commit" -x "README.md"
# Creates a release draft.
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
with:
name: ${{ env.PLUGIN_VERSION }}
tag: ${{ env.PLUGIN_VERSION }}
draft: true
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
generateReleaseNotes: true
skipIfReleaseExists: true
artifacts: wpgpt.zip