Skip to content

Commit

Permalink
Update package
Browse files Browse the repository at this point in the history
  • Loading branch information
kawsarahmedr committed Jul 30, 2024
2 parents 2d111f3 + c2e6183 commit 6dd8ac1
Show file tree
Hide file tree
Showing 15 changed files with 13,079 additions and 513 deletions.
22 changes: 0 additions & 22 deletions .dist.env

This file was deleted.

3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

17 changes: 0 additions & 17 deletions .eslintrc.js

This file was deleted.

68 changes: 0 additions & 68 deletions .github/workflows/code-quality.yml

This file was deleted.

44 changes: 44 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Linting

on:
pull_request:
branches:
- master
- feature/*
- release/*
workflow_dispatch:
inputs:
ref:
description: 'The branch to run the workflow on'
required: false
default: 'master'

jobs:
phpcs:
name: PHP Code Sniffer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup PHP version
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
coverage: none
tools: composer, cs2pr

- name: Install dependencies
run: composer install

- id: changes
run: |
URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files"
FILES=$(curl -s -X GET -G $URL | jq -r '.[] | .filename' | xargs)
echo "{files}={$FILES}" >> $GITHUB_OUTPUT
- name: Test changed files
run: ./vendor/bin/phpcs ${{ steps.changes.outputs.files }} --report-full --report-checkstyle=./.github/phpcs-report.xml --runtime-set testVersion 8.0

- name: Upload PHPCS report
if: ${{ always() }}
run: cs2pr ./.github/phpcs-report.xml
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "Build and Release plugin"
on:
release:
types: [published]

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP version
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
coverage: none
tools: composer

- name: Setup github token
run: composer config -g github-oauth.github.com ${{ secrets.ACCESS_TOKEN }}

- name: Build
run: |
composer install
composer update --no-dev --no-scripts
npm install && npm run build
- name: Release
id: release
uses: sultann/wordpress-plugin-deploy@master
with:
username: ${{ secrets.SVN_USERNAME }}
password: ${{ secrets.SVN_PASSWORD }}
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
5 changes: 0 additions & 5 deletions .stylelintrc.json

This file was deleted.

23 changes: 12 additions & 11 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
module.exports = function( grunt ) {
module.exports = function (grunt) {
'use strict';

// Load all grunt tasks matching the `grunt-*` pattern.
require( 'load-grunt-tasks' )( grunt );
require('load-grunt-tasks')(grunt);

// Show elapsed time.
require( '@lodder/time-grunt' )( grunt );
require('@lodder/time-grunt')(grunt);

// Project configuration.
grunt.initConfig(
{
package: grunt.file.readJSON( 'package.json' ),
addtextdomain: {
options: {
expand: true,
text_domain: 'wc-donation-manager',
<<<<<<< HEAD
updateDomains: [ 'bytekit-textdomain', 'textdomain' ],
=======
updateDomains: ['framework-text-domain'],
>>>>>>> master
},
plugin: {
files: {
Expand Down Expand Up @@ -64,12 +67,10 @@ module.exports = function( grunt ) {
target: {
options: {
domainPath: 'languages',
exclude: [ 'packages/*', '.git/*', 'node_modules/*', 'tests/*' ],
mainFile: '<%= package.name %>.php',
potFilename: '<%= package.name %>.pot',
exclude: ['packages/*', '.git/*', 'node_modules/*', 'tests/*'],
mainFile: 'wc-donation-manager.php',
potFilename: 'wc-donation-manager.pot',
potHeaders: {
'report-msgid-bugs-to': '<%= package.homepage %>',
'project-id-version': '<%= package.title %> <%= package.version %>',
poedit: true,
'x-poedit-keywordslist': true,
},
Expand All @@ -88,6 +89,6 @@ module.exports = function( grunt ) {
}
);

grunt.registerTask( 'i18n', [ 'addtextdomain', 'checktextdomain', 'makepot' ] );
grunt.registerTask( 'build', [ 'i18n' ] );
grunt.registerTask('i18n', ['addtextdomain', 'checktextdomain', 'makepot']);
grunt.registerTask('build', ['i18n']);
};
50 changes: 0 additions & 50 deletions bin/build-zip.sh

This file was deleted.

Loading

0 comments on commit 6dd8ac1

Please sign in to comment.