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
56 changes: 56 additions & 0 deletions .github/workflows/build-and-distribute.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build and distribute
on:
push:
branches: ['dev/**']
paths-ignore: ['docs/**', '**.md']
workflow_dispatch:
inputs:
PACKAGE_VERSION:
description: 'Package version (empty = derive from latest release)'
required: false
type: string
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
build:
uses: inpsyde/reusable-workflows/.github/workflows/build-and-distribute.yml@main
with:
PHP_VERSION: '7.4' # lowest supported PHP; the --no-dev install must resolve on it
NODE_VERSION: 'lts/krypton' # npm ci runs the preinstall engines check; matches upstream CI
PACKAGE_VERSION: ${{ inputs.PACKAGE_VERSION }}
secrets:
GITHUB_USER_EMAIL: ${{ secrets.DEPLOYBOT_EMAIL }}
GITHUB_USER_NAME: ${{ secrets.DEPLOYBOT_USER }}
GITHUB_USER_SSH_KEY: ${{ secrets.DEPLOYBOT_SSH_PRIVATE_KEY }}
GITHUB_USER_SSH_PUBLIC_KEY: ${{ secrets.DEPLOYBOT_SSH_PUBLIC_KEY }}

# The build changes what ships (.distignore, --no-dev vendor), so check the built package, not the source.
plugin-check-built:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download built package
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact }}
path: dist
- name: Verify built package
run: |
grep -E '^ \* (Version|SHA):' dist/multisyde/multisyde.php
grep -qF "SHA: ${{ github.sha }}" dist/multisyde/multisyde.php
test -f dist/multisyde/vendor/autoload.php
for d in .github tests docs bin node_modules .wordpress-org; do
if [ -e "dist/multisyde/$d" ]; then echo "::error::$d must not ship"; exit 1; fi
done
ls -A dist/multisyde
- name: Run plugin check
uses: wordpress/plugin-check-action@v1
with:
build-dir: './dist/multisyde'
exclude-files: 'modules/**/patches/*.php'
# Snapshot builds carry a non-release version (e.g. 0.0.0+main.<sha>), which never matches
# the readme Stable tag. The release workflow checks these two codes strictly.
ignore-codes: 'plugin_header_invalid_plugin_version,stable_tag_mismatch'
2 changes: 1 addition & 1 deletion .github/workflows/plugin-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
pull_request:
push:
branches:
- main
- dev/main
permissions:
contents: read
pull-requests: write
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ composer run phpstan
```bash
composer run qa
```
5. Push your branch and open a pull request against the main branch.
5. Push your branch and open a pull request against the `dev/main` branch. The `main` branch is generated by CI from `dev/main` and must not be targeted or edited directly.

Please include in your PR:
- A clear description of what your change does
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"npm": ">=11.16.0"
},
"scripts": {
"build": "echo \"No assets to build\"",
"preinstall": "npx check-node-version --package",
"prewp-env": "npx check-node-version --package",
"wp-env": "wp-env",
Expand Down
Loading