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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/README.md export-ignore
/.wordpress-org export-ignore
86 changes: 86 additions & 0 deletions .github/workflows/wporg-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Publishes the plugin to the WordPress.org directory
# (https://wordpress.org/plugins/hibira/) over SVN.
#
# - trunk/ <- git archive of this commit (export-ignore rules apply)
# - tags/<ver>/ <- copy of trunk, <ver> = Version in hibira.php
# - assets/ <- .wordpress-org/ (banners, icons, screenshots)
#
# Runs when a GitHub Release is published (tag v<Version>), or by hand from
# the Actions tab. The SVN password lives in the SVN_PASSWORD repository
# secret (WordPress.org profile → Account & Security → SVN password).
name: wporg-deploy
on:
release:
types: [published]
workflow_dispatch:
inputs:
dry_run:
description: Build and show the SVN changes without committing
type: boolean
default: false

permissions:
contents: read

concurrency: wporg-deploy

env:
SLUG: hibira
SVN_URL: https://plugins.svn.wordpress.org/hibira
SVN_USERNAME: hibira

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Versions agree
id: version
run: |
version="$(sed -n 's/^ \* Version: *//p' hibira.php)"
stable="$(sed -n 's/^Stable tag: *//p' readme.txt)"
[ "$version" = "$stable" ] || { echo "hibira.php $version != readme Stable tag $stable"; exit 1; }
if [ "$GITHUB_EVENT_NAME" = release ]; then
[ "v$version" = "$GITHUB_REF_NAME" ] || { echo "tag $GITHUB_REF_NAME != v$version"; exit 1; }
fi
echo "version=$version" >> "$GITHUB_OUTPUT"

- name: Install Subversion
run: command -v svn || { sudo apt-get update -qq && sudo apt-get install -y -qq subversion; }

- name: Stage trunk, tag and assets
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
svn checkout --depth immediates "$SVN_URL" svn
svn update --set-depth infinity svn/trunk svn/assets
mkdir build
git archive --format=tar HEAD | tar -x -C build
rsync -rc --delete --exclude=.svn build/ svn/trunk/
rsync -rc --delete --exclude=.svn .wordpress-org/ svn/assets/
cd svn
svn add --force trunk assets > /dev/null
svn status | awk '/^!/ {print $2}' | xargs -r svn delete
shopt -s nullglob
for f in assets/*.png; do svn propset -q svn:mime-type image/png "$f"; done
for f in assets/*.jpg; do svn propset -q svn:mime-type image/jpeg "$f"; done
if svn ls "$SVN_URL/tags/$VERSION" > /dev/null 2>&1; then
echo "::notice::tags/$VERSION already exists; updating trunk and assets only"
else
svn update -q --set-depth immediates tags
svn copy -q trunk "tags/$VERSION"
fi
svn status

- name: Commit
if: ${{ !inputs.dry_run }}
working-directory: svn
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
VERSION: ${{ steps.version.outputs.version }}
run: |
[ -n "$SVN_PASSWORD" ] || { echo "SVN_PASSWORD secret is not set"; exit 1; }
svn commit -m "Release $VERSION" \
--username "$SVN_USERNAME" --password "$SVN_PASSWORD" \
--non-interactive --no-auth-cache
Binary file added .wordpress-org/banner-1544x500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/banner-772x250.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/icon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/icon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ No Composer, no build step: the PHP side signs Hibira HTTP API calls itself

## Install

Until it is on WordPress.org: download `hibira.zip` from the
[latest release](https://github.com/hibira-io/wordpress/releases/latest), then
**Plugins → Add New → Upload Plugin**. Go to **Settings → Hibira**, paste the app ID, key
In wp-admin, **Plugins → Add New**, search for **Hibira Realtime** and install it
([wordpress.org/plugins/hibira](https://wordpress.org/plugins/hibira/)). Or download
`hibira.zip` from the [latest release](https://github.com/hibira-io/wordpress/releases/latest)
and use **Upload Plugin**. Go to **Settings → Hibira**, paste the app ID, key
and secret from your app in the [Hibira portal](https://hibira.io/portal)
(the free plan is enough) and press **Send a test event**.

Expand Down Expand Up @@ -96,6 +97,15 @@ files: WordPress.org builds and delivers them from
.po files for importing there; they are left out of the plugin zip. CI runs the
tests on PHP 7.4–8.4, PHPCS and the WordPress Plugin Check.

## Release

Bump `Version` in `hibira.php` and `Stable tag` in `readme.txt`, then publish a
GitHub Release tagged `v<version>`. Two workflows run: `release` attaches
`hibira.zip`, and `wporg-deploy` commits the same files to the WordPress.org SVN
repo (`trunk/`, `tags/<version>/`, and `.wordpress-org/` → `assets/`). It needs
the `SVN_PASSWORD` repository secret. To update only the banner or icons, run
`wporg-deploy` by hand from the Actions tab.

## License

GPL-2.0-or-later, like WordPress. pusher-js (`assets/vendor`) is MIT.
Loading