Skip to content

Commit 751dd7e

Browse files
committed
Release 0.4.0
1 parent d305f12 commit 751dd7e

28 files changed

Lines changed: 5143 additions & 4579 deletions

.distignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# What NOT to ship to WordPress.org or into the release zip.
2+
#
3+
# The deploy action copies this whole repository into trunk unless files are
4+
# listed here. .wp-env.json matters most: a dotfile in trunk trips Plugin
5+
# Check's "Hidden files are not permitted" error, which is a review finding
6+
# rather than a warning.
7+
8+
# Directories
9+
/.git
10+
/.github
11+
/.claude
12+
/.wordpress-org
13+
/node_modules
14+
15+
# Development-only files
16+
.distignore
17+
.gitattributes
18+
.gitignore
19+
.wp-env.json
20+
phpcs.xml
21+
README.md
22+
*.zip

.github/workflows/release.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Release plugin
2+
3+
# This repository IS the plugin: the packaged files sit at its root, so there
4+
# is nothing to build here. Pushing a version tag will:
5+
# 1. Verify the tag matches the plugin header, PAPO_VERSION and Stable tag
6+
# 2. Deploy to the WordPress.org SVN repository, listing assets included
7+
# 3. Attach the installable zip to a GitHub release
8+
#
9+
# Development happens in the product-options monorepo; scripts/publish-woo-repo.sh
10+
# syncs a release state here and pushes the tag that starts this workflow.
11+
#
12+
# Required repository secrets (Settings > Secrets and variables > Actions):
13+
# SVN_USERNAME -> printapp (case sensitive, NOT the email address)
14+
# SVN_PASSWORD -> the SVN-specific password from
15+
# https://profiles.wordpress.org/printapp/profile/edit/group/3/?screen=svn-password
16+
17+
on:
18+
push:
19+
tags:
20+
- 'v*' # e.g. v0.4.0
21+
- '[0-9]+.[0-9]+.[0-9]+' # e.g. 0.4.0
22+
23+
permissions:
24+
contents: write # required to create the GitHub release
25+
26+
jobs:
27+
release:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Derive version from tag
33+
id: version
34+
run: |
35+
TAG="${GITHUB_REF_NAME}"
36+
echo "version=${TAG#v}" >> "$GITHUB_OUTPUT"
37+
38+
# Stable tag is what the directory actually serves. If it disagrees with
39+
# the code the release "succeeds" while users keep downloading the old
40+
# build, so this is a hard failure rather than a warning.
41+
- name: Verify tag matches plugin version
42+
run: |
43+
PLUGIN=print-app-product-options-for-woocommerce.php
44+
HEADER=$(grep -oiP '^\s*\*\s*Version:\s*\K[0-9A-Za-z.\-]+' "$PLUGIN" | head -n1)
45+
CONST=$(grep -oP "PAPO_VERSION',\s*'\K[0-9A-Za-z.\-]+" "$PLUGIN" | head -n1)
46+
STABLE=$(grep -oiP '^Stable tag:\s*\K[0-9A-Za-z.\-]+' readme.txt | head -n1)
47+
WANT="${{ steps.version.outputs.version }}"
48+
echo "tag: $WANT | header: $HEADER | PAPO_VERSION: $CONST | Stable tag: $STABLE"
49+
FAIL=0
50+
[ "$HEADER" = "$WANT" ] || { echo "::error::Plugin header ($HEADER) != tag ($WANT)"; FAIL=1; }
51+
[ "$CONST" = "$WANT" ] || { echo "::error::PAPO_VERSION ($CONST) != tag ($WANT)"; FAIL=1; }
52+
[ "$STABLE" = "$WANT" ] || { echo "::error::Stable tag ($STABLE) != tag ($WANT)"; FAIL=1; }
53+
exit $FAIL
54+
55+
# ASSETS_DIR is .wordpress-org, NOT assets/ — this plugin ships its own
56+
# assets/ folder (the widget and builder bundles), and pointing the
57+
# listing assets at that name would upload the wrong files to the
58+
# plugin page. What reaches trunk is filtered by .distignore.
59+
- name: Deploy to WordPress.org SVN
60+
id: deploy
61+
uses: 10up/action-wordpress-plugin-deploy@stable
62+
with:
63+
generate-zip: true
64+
env:
65+
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
66+
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
67+
SLUG: print-app-product-options-for-woocommerce
68+
VERSION: ${{ steps.version.outputs.version }}
69+
ASSETS_DIR: .wordpress-org
70+
71+
- name: Create GitHub release
72+
uses: softprops/action-gh-release@v2
73+
with:
74+
name: Print Options for WooCommerce ${{ steps.version.outputs.version }}
75+
generate_release_notes: true
76+
files: ${{ steps.deploy.outputs.zip-path }}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Update wp.org assets & readme
2+
3+
# Updates ONLY the store listing on WordPress.org — the .wordpress-org assets
4+
# (banner, icon, screenshots) and readme.txt — without shipping a new version.
5+
#
6+
# MANUAL ONLY, DELIBERATELY. The obvious setup is to trigger this on pushes to
7+
# main that touch readme.txt, and that is what the Filecheck plugin does. It
8+
# fails on every release, because:
9+
#
10+
# the underlying action refuses to run when trunk contains changes beyond
11+
# the listing files, and a release commit necessarily brings the plugin code
12+
# with it. The job races the tag-triggered release, sees code it is not
13+
# allowed to deploy, and aborts with
14+
# "Other files have been modified; changes not deployed".
15+
#
16+
# The release workflow already ships the assets with every tag, so the only
17+
# real use for this one is a listing-only edit between releases — which is
18+
# exactly when a human presses the button.
19+
#
20+
# Uses the same SVN_USERNAME / SVN_PASSWORD secrets as the release workflow.
21+
22+
on:
23+
workflow_dispatch:
24+
25+
jobs:
26+
update-assets:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- name: Update readme and assets on WordPress.org
32+
uses: 10up/action-wordpress-plugin-asset-update@stable
33+
env:
34+
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
35+
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
36+
SLUG: print-app-product-options-for-woocommerce
37+
ASSETS_DIR: .wordpress-org
38+
README_NAME: readme.txt

.wordpress-org/banner-1544x500.png

82.7 KB
Loading

.wordpress-org/banner-772x250.png

25.7 KB
Loading

.wordpress-org/icon-128x128.png

3.55 KB
Loading

.wordpress-org/icon-256x256.png

7.69 KB
Loading

.wordpress-org/screenshot-1.png

240 KB
Loading

.wordpress-org/screenshot-2.png

292 KB
Loading

.wordpress-org/screenshot-3.png

308 KB
Loading

0 commit comments

Comments
 (0)