From 37bd66ee9b7e301c6358806e74f12ac6cf76fc42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Menrath?= Date: Tue, 29 Oct 2024 21:12:59 +0100 Subject: [PATCH] Streamline the release process with forgejo actions (#74) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also the .zip release files will only contain the needed production code, no development artifacts or tests. Reviewed-on: https://code.event-federation.eu/Event-Federation/wordpress-activitypub-event-bridge/pulls/74 Co-authored-by: André Menrath Co-committed-by: André Menrath --- .distignore | 16 +++------------- .forgejo/workflows/release.yml | 16 ++++++++++++++++ .gitattributes | 23 +++++++++++++++++++++++ activitypub-event-bridge.php | 4 ++-- includes/admin/class-health-check.php | 4 ++-- includes/class-settings.php | 6 +++--- includes/class-setup.php | 2 +- 7 files changed, 50 insertions(+), 21 deletions(-) create mode 100644 .forgejo/workflows/release.yml create mode 100644 .gitattributes diff --git a/.distignore b/.distignore index 36a7653..471f8fb 100644 --- a/.distignore +++ b/.distignore @@ -1,34 +1,24 @@ .distignore .git .gitignore -.php_cs -.svnignore .wordpress-org .wp-env.json -_config.yml -_site bin CHANGELOG.md CODE_OF_CONDUCT.md composer.json composer.lock +docker-compose.yml Dockerfile docs -docker-compose-test.yml -docker-compose.yml FEDERATION.md Gruntfile.js -Makefile node_modules -npm-debug.log -package-lock.json package.json +package-lock.json phpcs.xml phpunit.xml -phpunit.xml.dist README.md -readme.md -SECURITY.md src tests -vendor \ No newline at end of file +vendor diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml new file mode 100644 index 0000000..6aaf1ad --- /dev/null +++ b/.forgejo/workflows/release.yml @@ -0,0 +1,16 @@ +on: + push: + tags: 'v*' + +jobs: + upload-release: + runs-on: ubuntu-latest + steps: + - uses: https://code.forgejo.org/actions/checkout@v4 + + - uses: https://code.forgejo.org/actions/forgejo-release@v2 + with: + direction: upload + url: https://code.event-federation.eu + release-notes: ${{ TAG }} + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..ae639c6 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +.distignore export-ignore +.forgejo export-ignore +.gitattributes export-ignore +.gitignore export-ignore +.wp-env.json export-ignore +bin export-ignore +CODE_OF_CONDUCT.md export-ignore +composer.json export-ignore +composer.lock export-ignore +docker-compose.yml export-ignore +Dockerfile export-ignore +docs export-ignore +FEDERATION.md export-ignore +Gruntfile.js export-ignore +node_modules export-ignore +package.json export-ignore +package-lock.json export-ignore +phpcs.xml export-ignore +phpunit.xml export-ignore +README.md export-ignore +src export-ignore +tests export-ignore +vendor export-ignore diff --git a/activitypub-event-bridge.php b/activitypub-event-bridge.php index 1893a17..41557c8 100644 --- a/activitypub-event-bridge.php +++ b/activitypub-event-bridge.php @@ -8,10 +8,10 @@ * Author URI: https://graz.social/@linos * Text Domain: activitypub-event-bridge * License: AGPL-3.0-or-later - * License URI: https://www.gnu.org/licenses/agpl-3.0.de.html + * License URI: https://www.gnu.org/licenses/agpl-3.0.html * Requires PHP: 8.1 * - * Requires at least ActivityPub plugin with version >= 3.2.2. ActivityPub plugin tested up to: 3.3.3. + * Requires at least ActivityPub plugin with version >= 3.2.2. ActivityPub plugin tested up to: 4.0.1. * * @package ActivityPub_Event_Bridge * @license AGPL-3.0-or-later diff --git a/includes/admin/class-health-check.php b/includes/admin/class-health-check.php index 5fa3f9a..daaa0e0 100644 --- a/includes/admin/class-health-check.php +++ b/includes/admin/class-health-check.php @@ -47,7 +47,7 @@ class Health_Check { */ public static function test_event_transformation() { $result = array( - 'label' => \__( 'Transformation of Events to a valid ActivityStreams representation.', 'activitypub' ), + 'label' => \__( 'Transformation of Events to a valid ActivityStreams representation.', 'activitypub-event-bridge' ), 'status' => 'good', 'badge' => array( 'label' => \__( 'ActivityPub Event Bridge', 'activitypub-event-bridge' ), @@ -172,7 +172,7 @@ class Health_Check { 'label' => __( 'ActivityPub Event Bridge', 'activitypub-event-bridge' ), 'fields' => array( 'plugin_version' => array( - 'label' => __( 'Plugin Version', 'activitypub' ), + 'label' => __( 'Plugin Version', 'activitypub-event-bridge' ), 'value' => ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_VERSION, 'private' => true, ), diff --git a/includes/class-settings.php b/includes/class-settings.php index 3367dd1..6cd7d2e 100644 --- a/includes/class-settings.php +++ b/includes/class-settings.php @@ -44,7 +44,7 @@ class Settings { 'activitypub_event_bridge_default_event_category', array( 'type' => 'string', - 'description' => \__( 'Define your own custom post template', 'activitypub' ), + 'description' => \__( 'Define your own custom post template', 'activitypub-event-bridge' ), 'show_in_rest' => true, 'default' => self::DEFAULT_EVENT_CATEGORY, 'sanitize_callback' => array( self::class, 'sanitize_mapped_event_category' ), @@ -56,7 +56,7 @@ class Settings { 'activitypub_event_bridge_event_category_mappings', array( 'type' => 'array', - 'description' => \__( 'Define your own custom post template', 'activitypub' ), + 'description' => \__( 'Define your own custom post template', 'activitypub-event-bridge' ), 'default' => array(), 'sanitize_callback' => array( self::class, 'sanitize_event_category_mappings' ), ) @@ -67,7 +67,7 @@ class Settings { 'activitypub_event_bridge_initially_activated', array( 'type' => 'boolean', - 'description' => \__( 'Whether the plugin just got activated for the first time.', 'activitypub' ), + 'description' => \__( 'Whether the plugin just got activated for the first time.', 'activitypub-event-bridge' ), 'default' => 1, ) ); diff --git a/includes/class-setup.php b/includes/class-setup.php index 966d1d3..d919708 100644 --- a/includes/class-setup.php +++ b/includes/class-setup.php @@ -285,7 +285,7 @@ class Setup { foreach ( $this->active_event_plugins as $event_plugin ) { if ( ! in_array( $event_plugin->get_post_type(), $activitypub_supported_post_types, true ) ) { $activitypub_supported_post_types[] = $event_plugin->get_post_type(); - add_post_type_support( $event_plugin->get_post_type(), 'activitypub' ); + add_post_type_support( $event_plugin->get_post_type(), 'activitypub-event-bridge' ); } } update_option( 'activitypub_support_post_types', $activitypub_supported_post_types );