Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
185 commits
Select commit Hold shift + click to select a range
dc2b278
feat: php cs fixer
orzocogorzo Oct 1, 2025
6991ea5
feat: php unittest bootstrap
orzocogorzo Oct 1, 2025
7e454a0
feat: rename phpcs config file
orzocogorzo Oct 3, 2025
06719f6
feat: phpunit as composer dep
orzocogorzo Oct 3, 2025
47409d6
feat: mutations test
orzocogorzo Oct 3, 2025
2dfe4ca
feat: remove phpcs from composer
orzocogorzo Oct 4, 2025
eae1a7c
feat: wp-test-install script non interactive
orzocogorzo Oct 4, 2025
2f60651
feat: ci phpunit job
orzocogorzo Oct 4, 2025
6bee943
feat: use mariadb on install-wp-tests script
orzocogorzo Oct 4, 2025
aec7e22
feat: manualy start mariadbd on test ci job
orzocogorzo Oct 4, 2025
45cd4e7
feat: add delay after mariadbd background initialization on ci
orzocogorzo Oct 4, 2025
91829df
feat: rename phpunit.xml to dist
orzocogorzo Oct 4, 2025
a7b8061
feat: phpunit explicit config
orzocogorzo Oct 4, 2025
4354619
feat: update ci rules and use glab cli
orzocogorzo Oct 4, 2025
9d412f5
fix: release_job template rules
orzocogorzo Oct 4, 2025
680b473
fix: release_job template rules
orzocogorzo Oct 4, 2025
9fc2f18
fix: eslint react config and add eslint to lintstaged
orzocogorzo Oct 5, 2025
bf2aaaf
feat: register eslint npm dependencies and scripts
orzocogorzo Oct 5, 2025
f4a51b9
feat: php format with phpcs
orzocogorzo Oct 5, 2025
e149fa5
feat: update vendor locks
orzocogorzo Oct 24, 2025
f77a353
feat: apply lint fixes to js code
orzocogorzo Oct 5, 2025
72e5fe3
fix: relative require paths
orzocogorzo Oct 24, 2025
31b835d
feat: update readme.md
orzocogorzo Oct 24, 2025
bc60cd1
feat: update lintstaged php command
orzocogorzo Oct 24, 2025
4c58f76
feat: apply wp code standard rules
orzocogorzo Oct 24, 2025
5cbffb3
refactor: project nested directory structure
orzocogorzo Oct 24, 2025
d85c9b4
feat: reduce phpcbs warning level
orzocogorzo Oct 25, 2025
b683103
feat: update project dotfiles and configs to fit the new directory st…
orzocogorzo Oct 25, 2025
a29c754
fix: glab release params
orzocogorzo Oct 25, 2025
dfdcf03
feat: glab login on ci
orzocogorzo Oct 25, 2025
79ed0b6
feat: submodule commits
orzocogorzo Oct 25, 2025
3a6e96c
feat: rename common to plugin
orzocogorzo Oct 25, 2025
c594515
fix: plugin require paths
orzocogorzo Oct 25, 2025
0ea6945
feat: more rename common to plugin
orzocogorzo Oct 25, 2025
fb144d0
fix: multiple bug fixes
orzocogorzo Oct 25, 2025
e466e32
feat: register http setting
orzocogorzo Oct 26, 2025
1a1c513
feat: migration 4.0.7
orzocogorzo Oct 26, 2025
498a9b7
feat: encapsulate migrations
orzocogorzo Oct 26, 2025
99752f7
feat: run migrations with current version as fallback starting point
orzocogorzo Oct 26, 2025
35e36ff
fix: phpunit include paths
orzocogorzo Oct 26, 2025
fcf8191
feat: exclude disable short ternary cs rule
orzocogorzo Oct 26, 2025
0df76fe
feat: symlink on ci test job
orzocogorzo Oct 26, 2025
cfc8e68
feat: debug ci docker mount point
orzocogorzo Oct 26, 2025
eccbd11
feat: copy insted of link to relocate code instade the wp installatio…
orzocogorzo Oct 26, 2025
a0f6352
fix: plugin path determination on test environment
orzocogorzo Oct 26, 2025
04ed21c
feat: add bin/test-on-docker script
orzocogorzo Oct 26, 2025
6a0225e
feat: disable phpcs on tests/boostrap.php
orzocogorzo Oct 26, 2025
2c9c4ee
feat: bridge tests and test data
orzocogorzo Oct 27, 2025
5de22c3
feat: decorate test ci job output
orzocogorzo Oct 27, 2025
90afe82
feat: include tests directory on phpcs scope
orzocogorzo Oct 27, 2025
ee189c0
feat: add conditional attr on form field template schema
orzocogorzo Oct 27, 2025
3b6f994
fix: yaml syntax on ci file
orzocogorzo Oct 27, 2025
2e3ae4d
feat: decorate test ci job output
orzocogorzo Oct 27, 2025
01f5e3f
feat: decorate test ci job output
orzocogorzo Oct 27, 2025
c24c15d
feat: decorate test ci job output
orzocogorzo Oct 27, 2025
5b36a4e
fix: test-on-docker file extension
orzocogorzo Oct 27, 2025
8de6d5c
feat: decorate test ci job output
orzocogorzo Oct 27, 2025
777c492
feat: support matrixs on json finger expansion setters
orzocogorzo Nov 2, 2025
20e871a
feat: json finger tests
orzocogorzo Nov 2, 2025
5e53108
feat: increase ci mysql startup timeout on tests job
orzocogorzo Nov 2, 2025
c5c3bfd
feat: api crud methods for backend and credentials
orzocogorzo Nov 3, 2025
cb85a7d
feat: dynamic population of expanded setters
orzocogorzo Nov 3, 2025
ffd2ab2
feat: test mutation matrix
orzocogorzo Nov 3, 2025
e397643
feat: custom hooks test case
orzocogorzo Nov 3, 2025
7612e1e
fix: test-cusom-hooks test case
orzocogorzo Nov 3, 2025
f02798a
feat: http tests
orzocogorzo Nov 3, 2025
52af50c
feat: set up and tear down hooks on custom hooks test case
orzocogorzo Nov 3, 2025
8395558
feat: docstrings
orzocogorzo Nov 3, 2025
d89e88c
feat: add blueprint tests for addons and integrations
orzocogorzo Nov 3, 2025
aaf7865
feat: remove test-sample.php
orzocogorzo Nov 4, 2025
960b50d
feat: plugin test blueprints
orzocogorzo Nov 4, 2025
27f0f84
feat: wp coding standards and docstrings
orzocogorzo Nov 4, 2025
39b7eee
feat: wp coding standards and docstrings
orzocogorzo Nov 4, 2025
a5b893c
fix: workflow load error infinite loop
orzocogorzo Nov 4, 2025
a4cbaf8
feat: wp coding standards and docstrings
orzocogorzo Nov 4, 2025
30ee189
feat: install plugin deps on test bootstrap
orzocogorzo Nov 5, 2025
7cca613
feat: gf integration test case
orzocogorzo Nov 5, 2025
9cab5c0
feat: downdlad test deps script
orzocogorzo Nov 5, 2025
6244b17
feat: fallback temp dir on deps download script
orzocogorzo Nov 5, 2025
4b08dc9
feat: update download deps script arguments
orzocogorzo Nov 5, 2025
9309d4c
feat: ci logs
orzocogorzo Nov 5, 2025
1bc738c
feat: ci logs
orzocogorzo Nov 5, 2025
026fca8
feat: set bin/scripts executable
orzocogorzo Nov 5, 2025
d998285
feat: gf sr submission test and data
orzocogorzo Nov 5, 2025
d833415
feat: gf signup form test
orzocogorzo Nov 6, 2025
1fb7ca6
feat: gf signup form submission test
orzocogorzo Nov 6, 2025
1004905
feat: add cache and error handling on tests deps download script
orzocogorzo Nov 7, 2025
4ca975b
feat: base integration test class and contact form 7 test case
orzocogorzo Nov 7, 2025
89f90a2
feat: wpcf7 contact form test case
orzocogorzo Nov 7, 2025
a3146be
fix: test deps download script plugin dir variable
orzocogorzo Nov 7, 2025
5d6a64d
fix: test deps download script plugin dir variable
orzocogorzo Nov 7, 2025
2bee98d
feat: ci logs
orzocogorzo Nov 7, 2025
ef92101
fix: test deps download script unzip command
orzocogorzo Nov 7, 2025
2f9a0f2
feat: add github shields
orzocogorzo Nov 7, 2025
a9f9450
feat: github workflows
orzocogorzo Nov 7, 2025
1831a6a
feat: increase mysql timeout on ci
orzocogorzo Nov 7, 2025
26382fe
feat: split tests job into multiple steps
orzocogorzo Nov 7, 2025
95dcb50
fix: gh tests mariadb daemon start command typo
orzocogorzo Nov 7, 2025
669cee7
fix: gh tests workflow code checkout
orzocogorzo Nov 7, 2025
87c4e64
feat: recursive code checkout on gh ci
orzocogorzo Nov 7, 2025
820f0ee
fix: release workflow yaml
orzocogorzo Nov 7, 2025
3f2f880
fix: var replacement on gh yaml
orzocogorzo Nov 7, 2025
a9ea129
fix: readme tests badge
orzocogorzo Nov 7, 2025
9bebc7d
fix: readme inline badges
orzocogorzo Nov 7, 2025
66b599c
feat: use ubuntu latest image on gh workflows
orzocogorzo Nov 7, 2025
1daf95e
feat: work on release workflow
orzocogorzo Nov 7, 2025
895e8cd
fix: gh reuse workflow on the job level
orzocogorzo Nov 7, 2025
590b827
fix: upload-artifact deprecated version usage
orzocogorzo Nov 7, 2025
98d91ca
feat: debug step on gh ci
orzocogorzo Nov 7, 2025
a29de4b
feat: more debug logs
orzocogorzo Nov 7, 2025
24c6688
fix: js src textdomain replacement step on ci jobs
orzocogorzo Nov 7, 2025
6035893
fix: upload/download npm build artifact
orzocogorzo Nov 8, 2025
9316ca2
fix: checkout code on each release job workflow
orzocogorzo Nov 8, 2025
bc53b62
feat: witch to archive to inherit builds on gh actions
orzocogorzo Nov 8, 2025
f055734
fix: download build artifact path
orzocogorzo Nov 8, 2025
fefed7c
fix: textdomain replacement on php deps
orzocogorzo Nov 8, 2025
1d52b69
feat: play with upload/download paths
orzocogorzo Nov 8, 2025
2ecc6f4
feat: setup node before download
orzocogorzo Nov 8, 2025
573aae0
fix: textdomain replacement on php deps
orzocogorzo Nov 8, 2025
2e82299
feat: gl release multiline command
orzocogorzo Nov 8, 2025
7cb8cbc
feat: gl release multiline command
orzocogorzo Nov 8, 2025
f164f21
feat: debug workflow
orzocogorzo Nov 8, 2025
76d11b9
feat: add cache to gitlab ci
orzocogorzo Nov 8, 2025
7de8d36
feat: track node modules on gitlab ci cache
orzocogorzo Nov 8, 2025
a3d4de8
fix: php plugin namescpae replacements
orzocogorzo Nov 8, 2025
3b968b6
feat: github checkout code with submodules on release workflow
orzocogorzo Nov 8, 2025
684608a
fix: release downlaod artifact path
orzocogorzo Nov 8, 2025
4b8ea9e
feat: add node_modules cache on gh actions
orzocogorzo Nov 8, 2025
ca6a627
feat: add npm cache keys
orzocogorzo Nov 8, 2025
183f4e9
feat: cache node_modules on gh release workflow
orzocogorzo Nov 8, 2025
cea8021
fix: release workflow cache keys
orzocogorzo Nov 8, 2025
4236259
feat: move cache step after checkout code to hash lock file
orzocogorzo Nov 8, 2025
2e2d6df
feat: composer cache on CIs
orzocogorzo Nov 8, 2025
b8b3293
fix: gitlab ci composer cache yaml
orzocogorzo Nov 8, 2025
8a7e4fe
feat: forward code from build to package as a checkout
orzocogorzo Nov 8, 2025
dbf6ab1
debug release job
orzocogorzo Nov 8, 2025
feeda6a
debug release job
orzocogorzo Nov 8, 2025
1c68cc5
debug release job
orzocogorzo Nov 8, 2025
fc7b31d
debug release job
orzocogorzo Nov 8, 2025
72bb6b5
debug release job
orzocogorzo Nov 8, 2025
19292ee
debug release job
orzocogorzo Nov 8, 2025
b33b078
debug release job
orzocogorzo Nov 8, 2025
f723548
debug release job
orzocogorzo Nov 8, 2025
da7e8f5
debug release job
orzocogorzo Nov 8, 2025
e412b42
debug release job
orzocogorzo Nov 8, 2025
3788f56
feat: disable debug mode on release workflow
orzocogorzo Nov 8, 2025
6646f93
feat: update COC.md
orzocogorzo Nov 8, 2025
4271be3
feat: update README.md
orzocogorzo Nov 8, 2025
9026862
feat: update readme.txt
orzocogorzo Nov 8, 2025
4a512f3
feat: copy license.txt to LICENSE
orzocogorzo Nov 8, 2025
b8a7351
feat: plugin tests bootstrap and setting test case
orzocogorzo Nov 9, 2025
6f2a596
feat: json schema test case
orzocogorzo Nov 10, 2025
acbe518
feat: add woo as test dep
orzocogorzo Nov 10, 2025
5cad16b
feat: support for tel form field and rename boolean field type to che…
orzocogorzo Nov 10, 2025
c321387
feat: integrations' tel form field and rename field data _type prop t…
orzocogorzo Nov 10, 2025
9cf8083
feat: assert field options
orzocogorzo Nov 10, 2025
22abb90
feat: wpforms integration form serialization tests
orzocogorzo Nov 10, 2025
e88c743
feat: trim name and label of form field serialized data
orzocogorzo Nov 10, 2025
92275f6
feat :wpforms submission serialization tests
orzocogorzo Nov 10, 2025
619fbea
feat: wpform field options label as fallback value
orzocogorzo Nov 10, 2025
8195fbc
fix: set gf list field as multiple
orzocogorzo Nov 10, 2025
cc7a346
feat: new gf integration tests
orzocogorzo Nov 10, 2025
62af6e6
feat: ninja forms serialization tests
orzocogorzo Nov 10, 2025
75c5cf1
feat: ninja form submission serialization tests
orzocogorzo Nov 11, 2025
698d4fd
feat: phpdocs
orzocogorzo Nov 11, 2025
6d14367
feat: test woo order serialization
orzocogorzo Nov 11, 2025
ca7dcdd
feat: gf checkbox field generator
orzocogorzo Nov 11, 2025
bd2dccc
feat: test integrations' form tempalates
orzocogorzo Nov 11, 2025
74da553
feat: wpforms and ninja checkbox field generator
orzocogorzo Nov 11, 2025
96ec9f9
fix: backend step wired icon effects
orzocogorzo Nov 12, 2025
f9cf42b
fix: addon name constant access on rest controller
orzocogorzo Nov 12, 2025
026d68a
fix: php warnings
orzocogorzo Nov 12, 2025
9db1a6a
fix: holded vat prefix job
orzocogorzo Nov 12, 2025
6dcf0af
fix: common jobs load
orzocogorzo Nov 12, 2025
1faf3e3
feat: settings import order checks
orzocogorzo Nov 12, 2025
6ca6a17
feat: credential and backend database crud methods
orzocogorzo Nov 12, 2025
1a337f3
fix: woo integration order serialization call
orzocogorzo Nov 12, 2025
8b20231
feat: increase test ci job mysql await timeout
orzocogorzo Nov 12, 2025
5f1b1be
feat: add lint job on tests ci workflow
orzocogorzo Nov 12, 2025
d934c82
fix: lint job name
orzocogorzo Nov 12, 2025
57b8968
feat: gitlab ci pipline lint job
orzocogorzo Nov 12, 2025
2eae866
fix: gitlab test job template
orzocogorzo Nov 12, 2025
b210a16
fix: test jobs inheritance
orzocogorzo Nov 12, 2025
3bcbf3d
feat: nextcloud addon phpdocs
orzocogorzo Nov 12, 2025
cdd40ad
fix: ninja action processing warnings
orzocogorzo Nov 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
121 changes: 121 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Release

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"

permissions:
contents: "write"

jobs:
tests:
name: Release tests
uses: ./.github/workflows/tests.yml

build:
name: Build client
runs-on: ubuntu-latest
needs: tests
steps:
- name: Setup node
uses: actions/setup-node@v6

- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true

- name: Cache node modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- name: Install dependencies
run: npm ci

- name: Replace textdomains
run: find src -exec sed -i "s/http-bridge/forms-bridge/g" {} \;

- name: Build
run: npm run build

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: build
path: forms-bridge/assets/plugin.bundle.js

package:
name: Prepare package
runs-on: ubuntu-latest
container:
image: codeccoop/wp-cli
env:
ZIP: "${{ github.ref_name }}.zip"
needs: build
steps:
- name: Setup node
uses: actions/setup-node@v6

- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true

- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build
path: forms-bridge/assets

- name: Install dist archive
run: wp package install wp-cli/dist-archive-command:@stable

- name: Replace textdomains
run: |
find forms-bridge/deps/plugin -name '*.php' -exec sed -i "s/wpct-plugin/forms-bridge/g" {} \;
find forms-bridge -name '*.php' -exec sed -i "s/wpct_plugin_/forms_bridge_plugin_/g" {} \;
find forms-bridge -name "*.php" -exec sed -i 's/WPCT_PLUGIN/FORMS_BRIDGE\\Plugin/g' {} \;
find forms-bridge/deps/http -name '*.php' -exec sed -i "s/http-bridge/forms-bridge/g" {} \;
find forms-bridge -name '*.php' -exec sed -i "s/http_bridge_/forms_bridge_http_/g" {} \;
find forms-bridge -name "*.php" -exec sed -i 's/HTTP_BRIDGE_/FORMS_BRIDGE_HTTP_/g' {} \;
find forms-bridge -name '*.php' -exec sed -i 's/HTTP_BRIDGE/FORMS_BRIDGE\\Http/g' {} \;

- name: Archive
run: wp dist-archive forms-bridge ./"$ZIP"

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: plugin-archive
path: ${{ env.ZIP }}

release:
name: Release pushed tag
runs-on: ubuntu-latest
needs: package
env:
ZIP: "${{ github.ref_name }}.zip"
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: plugin-archive

- name: Create release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ github.ref_name }}
run: |
mv $ZIP forms-bridge.zip
gh release create "$TAG" \
--repo="$GITHUB_REPOSITORY" \
--title="$TAG" \
--generate-notes \
"forms-bridge.zip"
66 changes: 66 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Tests

on:
pull_request:
branches: [main]

workflow_call:

jobs:
lint:
name: WordPress Coding Standards
runs-on: ubuntu-latest
container:
image: codeccoop/wp-test
steps:
- uses: actions/checkout@v5

- name: Composer install
run: composer -q install

- name: Lint and format
run: vendor/bin/phpcbf

phpunit:
name: PHP Unit Testing
runs-on: ubuntu-latest
container:
image: codeccoop/wp-test
steps:
- name: Start MariaDB
run: nohup docker-entrypoint.sh mariadbd 2>&1 >/dev/null &

- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true

- name: Cache composer
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('composer.lock') }}

- name: Cache plugins
uses: actions/cache@v4
with:
path: /tmp/*.zip
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('bin/download-test-deps.sh') }}

- name: Composer install
run: composer -q install

- name: Wait for MariaDB
run: sleep 10

- name: Executable mode
run: chmod a+x bin/*

- name: Install tests suite
run: bin/install-wp-tests.sh

- name: Download deps
run: bin/download-test-deps.sh

- name: Unit testing
run: vendor/bin/phpunit -c phpunit.xml.dist
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.DS_Store
phpcs.xml
phpunit.xml
.phpunit.result.cache
.php-cs-fixer.cache
Thumbs.db
wp-cli.local.yml
node_modules/
Expand Down
118 changes: 84 additions & 34 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
workflow:
rules:
- if: $CI_COMMIT_BRANCH
changes:
- README.md
- .gitlab-ci.yml
when:
never
# Do no allow manually triggered pipelines to prevent duplicates!
# Instead rerun the pipeline created with the last push
- if: $CI_PIPELINE_SOURCE != "push"
when: never
# Only execute when a valid version tag like 1.0, 2.3-dev or similar is given
# Required is always one point like 1.0
- if: $CI_COMMIT_TAG =~ /^[0-9]+[.][0-9]+([.][0-9]+)?([-a-z])*$/

stages: # List of stages for jobs, and their order of execution
# List of stages for jobs, and their order of execution
stages:
- test
- build
- package
- upload
Expand All @@ -32,49 +18,113 @@ variables:
GIT_SUBMODULE_STRATEGY: normal
GIT_SUBMODULE_FORCE_HTTPS: "true"

.release_job:
rules:
# Only execute when a valid version tag like 1.0, 2.3-dev or similar is given
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^[0-9]+[.][0-9]+([.][0-9]+)?([-a-z])*$/

.test_job:
stage: test
image: codeccoop/wp-test
cache:
- key:
files:
- bin/download-test-deps.sh
paths:
- /tmp/*.zip

- key:
files:
- composer.lock
paths:
- vendor
rules:
# Only execute when a valid version tag like 1.0, 2.3-dev or similar is given
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^[0-9]+[.][0-9]+([.][0-9]+)?([-a-z])*$/
# Run always on MR pointing to master
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH

lint:
extends: .test_job
before_script:
- composer -q install
script:
- vendor/bin/phpcbf

phpunit:
extends: .test_job
before_script:
- nohup docker-entrypoint.sh mariadbd 2>&1 >/dev/null &
- composer -q install
- sleep 10
- chmod a+x bin/*
- bin/install-wp-tests.sh
- bin/download-test-deps.sh
script:
- vendor/bin/phpunit -c phpunit.xml.dist

build:
extends: .release_job
stage: build
image: node:latest
cache:
- key:
files:
- package-lock.json
paths:
- node_modules
script:
- find src -exec sed -i "s/http-bridge/forms-bridge/g" {} \;
- npm install && npm run build
- rm -rf node_modules
artifacts:
paths:
- assets/plugin.bundle.js
- forms-bridge/assets/plugin.bundle.js

package:
extends: .release_job
image: codeccoop/wp-cli:latest
stage: package
dependencies: [build]
script:
- find common -name '*.php' -exec sed -i "s/wpct-plugin/forms-bridge/g" {} \;
- find . -name '*.php' -exec sed -i "s/wpct_plugin_/forms_bridge_plugin_/g" {} \;
- find . -name "*.php" -exec sed -i 's/WPCT_PLUGIN/FORMS_BRIDGE\\Common/g' {} \;
- find deps/http -name '*.php' -exec sed -i "s/http-bridge/forms-bridge/g" {} \;
- find . -name '*.php' -exec sed -i "s/http_bridge_/forms_bridge_http_/g" {} \;
- find . -name "*.php" -exec sed -i 's/HTTP_BRIDGE_/FORMS_BRIDGE_HTTP_/g' {} \;
- find . -name '*.php' -exec sed -i 's/HTTP_BRIDGE/FORMS_BRIDGE\\Http/g' {} \;
- find deps/i18n -name '*.php' -exec sed -i "s/wpct-i18n/forms-bridge/g" {} \;
- find . -name '*.php' -exec sed -i "s/wpct_i18n_/forms_bridge_i18n_/g" {} \;
- find . -name '*.php' -exec sed -i 's/WPCT_I18N/FORMS_BRIDGE\\I18n/g' {} \;
- wp dist-archive . ./$ZIP
- find forms-bridge/deps/plugin -name '*.php' -exec sed -i "s/wpct-plugin/forms-bridge/g" {} \;
- find forms-bridge -name '*.php' -exec sed -i "s/wpct_plugin_/forms_bridge_plugin_/g" {} \;
- find forms-bridge -name "*.php" -exec sed -i 's/WPCT_PLUGIN/FORMS_BRIDGE\\Plugin/g' {} \;
- find forms-bridge/deps/http -name '*.php' -exec sed -i "s/http-bridge/forms-bridge/g" {} \;
- find forms-bridge -name '*.php' -exec sed -i "s/http_bridge_/forms_bridge_http_/g" {} \;
- find forms-bridge -name "*.php" -exec sed -i 's/HTTP_BRIDGE_/FORMS_BRIDGE_HTTP_/g' {} \;
- find forms-bridge -name '*.php' -exec sed -i 's/HTTP_BRIDGE/FORMS_BRIDGE\\Http/g' {} \;
- wp dist-archive forms-bridge ./$ZIP
artifacts:
paths:
- $ZIP

upload:
extends: .release_job
stage: upload
image: curlimages/curl:latest
dependencies: [package]
script:
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file ${ZIP} ${PACKAGE_REGISTRY_URL}/${ZIP}
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" \
--upload-file ${ZIP} \
${PACKAGE_REGISTRY_URL}/${ZIP}

release:
# Caution, as of 2021-02-02 these assets links require a login, see:
# https://gitlab.com/gitlab-org/gitlab/-/issues/299384
extends: .release_job
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
image: gitlab/glab:latest
dependencies: [package]
variables:
GITLAB_HOST: "$CI_SERVER_URL"
script:
- |
release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \
--assets-link "{\"name\":\"${ZIP}\",\"url\":\"${PACKAGE_REGISTRY_URL}\/${ZIP}\",\"link_type\":\"package\",\"filepath\":\"\/plugins\/bridges\/${ZIP}\"}"
glab auth login \
--job-token $CI_JOB_TOKEN \
--hostname $CI_SERVER_HOST \
--api-protocol $CI_SERVER_PROTOCOL
- |
glab release create $CI_COMMIT_TAG\
--name "Release $CI_COMMIT_TAG" \
--assets-links "[{\"name\":\"${ZIP}\",\"url\":\"${PACKAGE_REGISTRY_URL}\/${ZIP}\",\"link_type\":\"package\",\"direct_asset_path\":\"\/plugins\/bridges\/${ZIP}\"}]"
15 changes: 6 additions & 9 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[submodule "common"]
path = common
url = https://git.coopdevs.org/codeccoop/wp/plugins/wpct-plugin-common.git
[submodule "deps/http"]
path = deps/http
url = https://git.coopdevs.org/codeccoop/wp/plugins/bridges/http-bridge.git
[submodule "deps/i18n"]
path = deps/i18n
url = https://git.coopdevs.org/codeccoop/wp/plugins/wpct-i18n.git
[submodule "forms-bridge/plugin"]
path = forms-bridge/deps/plugin
url = https://gitlab.com/codeccoop/wp/plugins/wpct-plugin.git
[submodule "forms-bridge/deps/http"]
path = forms-bridge/deps/http
url = https://gitlab.com/codeccoop/wp/plugins/http-bridge.git
10 changes: 5 additions & 5 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ const buildPrettierCommand = (filenames) =>
.map((f) => path.relative(process.cwd(), f))
.join(" ")}`;

const buildPrettierPhpCommand = (filenames) =>
`prettier --write --ignore-unknown --config .prettierrc-php ${filenames
const buildPhpCbfCommand = (filenames) =>
`vendor/bin/phpcbf -n ${filenames
.map((f) => path.relative(process.cwd(), f))
.join(" ")}`;

module.exports = {
// "src/**/*.{js,jsx,ts,tsx}": [buildEslintCommand],
"*.{json,js,ts,jsx,tsx,html,css}": [buildPrettierCommand],
"*.php": [buildPrettierPhpCommand],
"src/**/*.{js,jsx}": [buildEslintCommand],
"*.{json,js,jsx,html,css}": [buildPrettierCommand],
"*.php": [buildPhpCbfCommand],
};
Loading