Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/
# https://developer.wordpress.org/coding-standards/wordpress-coding-standards/

root = true

Expand All @@ -10,9 +13,19 @@ insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab

[{.babelrc,.eslintrc,.rtlcssrc,*.json,*.yml}]
indent_style = space
[*.json]
indent_size = 2

[*.md]
trim_trailing_whitespace = false
trim_trailing_whitespace = false
indent_style = space
indent_size = 2

[*.txt]
trim_trailing_whitespace = false

[*.{yml,yaml}]
insert_final_newline = false
quote_type = single
indent_style = space
indent_size = 2
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
**/*.min.js
**/node_modules/**
**/vendor/**
build/*
**/build/**
2 changes: 1 addition & 1 deletion .eslintrc → .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
// Add Rules for Jest here
}
} ]
}
}
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,3 @@ If you can't do everything, that's okay too.
- [ ] My code passes all lints (ESLint etc.).
- [ ] My code has detailed inline documentation.
- [ ] I have updated the project documentation as needed.
- [ ] I have added a changeset for this PR using `npm run changeset`.
57 changes: 57 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: "Copilot Setup Steps"

# Automatically run the setup steps when they are changed to allow for easy validation, and
# allow manual testing through the repository's "Actions" tab
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml

jobs:
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
copilot-setup-steps:
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
persist-credentials: false

##
# This allows Composer dependencies to be installed using a single step.
#
# Since the tests are currently run within the Docker containers where the PHP version varies,
# the same PHP version needs to be configured for the action runner machine so that the correct
# dependency versions are installed and cached.
##
- name: Set up PHP
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5
with:
php-version: "8.3"
coverage: none

- name: Install Composer dependencies
uses: ramsey/composer-install@a2636af0004d1c0499ffca16ac0b4cc94df70565 # v3.1.0

- name: Setup Node
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v5.0.0
with:
cache: "npm"
node-version-file: ".nvmrc"

- name: Install NPM dependencies
run: npm ci
env:
CI: true

- name: Build assets for development
run: npm run build:dev
21 changes: 0 additions & 21 deletions .github/workflows/phpcs_on_pull_request.yml

This file was deleted.

67 changes: 67 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Upload Package on Release
permissions:
contents: write

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

on:
release:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we do this on tag instead of release so that we can directly generate plugin zip with dev tags also from our branch for efficient QA?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about it makes QA more efficient?

(In general, this plugin is just POC, so I'd much rather an intentional GH-hosted release process and only create a tag on GH release instead of first creating tags > deriving the release > releasing. )

types: [published]

jobs:
tag:
name: Upload New Release
runs-on: ubuntu-24.04

steps:
- name: Checkout repository
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
persist-credentials: false

- name: Set up PHP
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5
with:
php-version: "8.3"
coverage: none
tools: composer:v2

- name: Install Composer dependencies
uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # v3.1.1

- name: Setup Node
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v5.0.0
with:
cache: "npm"
node-version-file: ".nvmrc"

- name: Install NPM dependencies
run: npm ci
env:
CI: true

- name: Build JavaScript assets
run: npm run build:prod

- name: Create Artifact
run: |
npm run plugin-zip

- name: Upload artifact
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: onedesign
path: onedesign.zip

- name: Upload release asset
uses: softprops/action-gh-release@5be0e66d93ac7ed76da52eca8bb058f665c3a5fe # v2.4.2
with:
files: onedesign.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70 changes: 0 additions & 70 deletions .github/workflows/release_on_tag.yml

This file was deleted.

Loading
Loading