diff --git a/.editorconfig b/.editorconfig index 922986d27..9920ff350 100644 --- a/.editorconfig +++ b/.editorconfig @@ -14,3 +14,6 @@ trim_trailing_whitespace = false [*.{js,json,yml}] indent_style = space + +[*.yml] +indent_size = 2 diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 000000000..6d4d11f21 --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,41 @@ +name: Build package + +on: + workflow_dispatch: + inputs: + packageVersion: + description: 'Package Version' + required: false + type: string + +jobs: + package: + runs-on: ubuntu-latest + + name: Build package + steps: + - uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.1 + tools: composer:v1 + + - name: Set plugin version header + env: + PACKAGE_VERSION: ${{ github.event.inputs.packageVersion }} + run: 'sed -Ei "s/Version: .*/Version: ${PACKAGE_VERSION}/g" woocommerce-paypal-payments.php' + if: github.event.inputs.packageVersion + + - name: Build + run: yarn build + + - name: Unzip # GH currently always zips, so if we upload a zip we get a zip inside a zip + run: unzip woocommerce-paypal-payments.zip -d dist + + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: woocommerce-paypal-payments + path: dist/