woocommerce-paypal-payments/.github/workflows/package.yml
2024-08-26 14:54:07 +03:00

32 lines
1 KiB
YAML

name: Build package
on:
workflow_dispatch:
inputs:
packageVersion:
description: 'Package version'
required: false
type: string
jobs:
check_version:
runs-on: ubuntu-latest
env:
PACKAGE_VERSION: ${{ github.event.inputs.packageVersion }}
outputs:
version: ${{ env.PACKAGE_VERSION }}
name: Check version
steps:
- uses: actions/checkout@v2
- name: Fix plugin version input # Add the version number if only suffix entered
id: fix_version
run: echo "PACKAGE_VERSION=$(sed -nE '/Version:/s/.* ([0-9.]+).*/\1/p' woocommerce-paypal-payments.php)-$PACKAGE_VERSION" >> $GITHUB_ENV
if: env.PACKAGE_VERSION && !contains(env.PACKAGE_VERSION, '.')
create_archive:
needs: check_version
uses: inpsyde/reusable-workflows/.github/workflows/build-plugin-archive.yml@prefixed-archives
with:
PHP_VERSION: 7.2
PLUGIN_MAIN_FILE: ./woocommerce-paypal-payments.php
PLUGIN_VERSION: ${{ needs.check_version.outputs.version }}