Skip to content

Commit 8824c33

Browse files
committed
Fix bug when multisite loaded as the only plugin. Add auto release workflow.
1 parent f607214 commit 8824c33

3 files changed

Lines changed: 51 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
17+
# Docs: https://getcomposer.org/doc/articles/scripts.md
18+
19+
# - name: Run test suite
20+
# run: composer run-script test
21+
22+
# Below borrowed from https://github.com/actions/upload-release-asset
23+
- name: Build project
24+
run: |
25+
mkdir disciple-tools-multisite-master |
26+
cp -r disciple-tools-multisite.php LICENSE SECURITY.md includes languages spinner.svg disciple-tools-multisite-master/ |
27+
zip -r disciple-tools-multisite.zip disciple-tools-multisite-master
28+
- name: Create Release
29+
id: create_release
30+
uses: actions/create-release@v1
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
with:
34+
tag_name: ${{ github.ref }}
35+
release_name: Release v${{ github.ref }}
36+
draft: false
37+
prerelease: false
38+
- name: Upload Release Asset
39+
id: upload-release-asset
40+
uses: actions/upload-release-asset@v1
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
with:
44+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
45+
asset_path: ./disciple-tools-multisite.zip
46+
asset_name: disciple-tools-multisite.zip
47+
asset_content_type: application/zip

disciple-tools-multisite.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Disciple Tools - Multisite
44
* Plugin URI: https://github.com/DiscipleTools/disciple-tools-multisite
55
* Description: Disciple Tools Multisite plugin adds network administration utilities to the multisite network admin area, helpful for managing Disciple Tools multisite installs.
6-
* Version: 1.6
6+
* Version: 1.6.1
77
* Author URI: https://github.com/DiscipleTools
88
* GitHub Plugin URI: https://github.com/DiscipleTools/disciple-tools-multisite
99
* Requires at least: 4.7.0
@@ -213,14 +213,14 @@ public function __call( $method = '', $args = array() ) {
213213
/**
214214
* Make the update checker available on multisites when the default theme is not Disciple.Tools
215215
*/
216-
if ( is_multisite() && is_network_admin() ){
216+
if ( is_multisite() && ( is_network_admin() || wp_doing_cron() ) ){
217217
if ( !class_exists( 'Puc_v4_Factory' ) ){
218218
require( "includes/admin/plugin-update-checker/plugin-update-checker.php" );
219219
}
220220
}
221221

222222
add_action( 'plugins_loaded', function (){
223-
if ( is_multisite() && ( is_admin() || wp_doing_cron() ) ){
223+
if ( is_multisite() && ( is_network_admin() || wp_doing_cron() ) ){
224224
// find the Disciple.Tools theme and load the plugin update checker.
225225
foreach ( wp_get_themes() as $theme ){
226226
if ( $theme->get( 'TextDomain' ) === "disciple_tools" && file_exists( $theme->get_stylesheet_directory() . '/dt-core/libraries/plugin-update-checker/plugin-update-checker.php' ) ){

version-control.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Disciple Tools - Multisite",
3-
"version": "1.6",
3+
"version": "1.6.1",
44
"last_updated": "2021-01",
55
"author": "Disciple Tools",
66
"author_homepage": "https://disciple.tools",

0 commit comments

Comments
 (0)