Skip to content

Commit f6fd3a8

Browse files
author
Laur0r
authored
Merge pull request #19 from justusdieckmann/update/m40
Update for Moodle 4.0
2 parents 5a2b740 + 6ea153c commit f6fd3a8

File tree

4 files changed

+70
-9
lines changed

4 files changed

+70
-9
lines changed

.github/workflows/moodle-ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ jobs:
99
strategy:
1010
matrix:
1111
php: ['7.4']
12-
moodle-branch: ['MOODLE_311_STABLE']
12+
moodle-branch: ['MOODLE_400_STABLE']
1313
database: ['pgsql']
1414

1515
steps:
1616
- name: Start PostgreSQL
17-
run: docker run -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres:9.6
17+
run: docker run -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres:10
1818

1919
- name: Check out repository code
2020
uses: actions/checkout@v2
@@ -106,18 +106,18 @@ jobs:
106106
strategy:
107107
fail-fast: false
108108
matrix:
109-
php: ['7.3', '7.4']
110-
moodle-branch: ['MOODLE_39_STABLE', 'MOODLE_310_STABLE', 'MOODLE_311_STABLE']
109+
php: ['7.4']
110+
moodle-branch: ['MOODLE_39_STABLE', 'MOODLE_310_STABLE', 'MOODLE_311_STABLE', 'MOODLE_400_STABLE']
111111
database: ['mariadb', 'pgsql']
112112

113113
steps:
114114
- name: Start MariaDB
115115
if: matrix.database == 'mariadb'
116-
run: docker run -p 3306:3306 -e MYSQL_USER=root -e MYSQL_ALLOW_EMPTY_PASSWORD=true -d mariadb:10.5
116+
run: docker run -p 3306:3306 -e MYSQL_USER=root -e MYSQL_ALLOW_EMPTY_PASSWORD=true -d mariadb:10
117117

118118
- name: Start PostgreSQL
119119
if: matrix.database == 'pgsql'
120-
run: docker run -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres:9.6
120+
run: docker run -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres:10
121121

122122
- name: Check out repository code
123123
uses: actions/checkout@v2
@@ -169,4 +169,4 @@ jobs:
169169

170170
- name: Behat features
171171
if: ${{ always() }}
172-
run: moodle-plugin-ci behat --profile chrome
172+
run: moodle-plugin-ci behat --profile chrome --auto-rerun 0

.github/workflows/moodle-release.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#
2+
# Whenever a new tag starting with "v" is pushed, add the tagged version
3+
# to the Moodle Plugins directory at https://moodle.org/plugins
4+
#
5+
# revision: 2021070201
6+
# Changed to be released on Github release with the release notes.
7+
#
8+
name: Releasing in the Plugins directory
9+
10+
on:
11+
release:
12+
types: [published]
13+
14+
defaults:
15+
run:
16+
shell: bash
17+
18+
jobs:
19+
release-at-moodle-org:
20+
runs-on: ubuntu-latest
21+
env:
22+
PLUGIN: mod_groupmembers
23+
CURL: curl -s
24+
ENDPOINT: https://moodle.org/webservice/rest/server.php
25+
TOKEN: ${{ secrets.MOODLE_ORG_TOKEN }}
26+
FUNCTION: local_plugins_add_version
27+
28+
steps:
29+
- name: Call the service function
30+
id: add-version
31+
run: |
32+
TAGNAME="${{ github.event.release.tag_name }}"
33+
BODY="${{ github.event.release.body }}"
34+
ZIPURL="${{ github.event.release.zipball_url }}"
35+
RESPONSE=$(${CURL} ${ENDPOINT} --data-urlencode "wstoken=${TOKEN}" \
36+
--data-urlencode "wsfunction=${FUNCTION}" \
37+
--data-urlencode "moodlewsrestformat=json" \
38+
--data-urlencode "frankenstyle=${PLUGIN}" \
39+
--data-urlencode "zipurl=${ZIPURL}" \
40+
--data-urlencode "vcssystem=git" \
41+
--data-urlencode "vcsrepositoryurl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" \
42+
--data-urlencode "vcstag=${TAGNAME}" \
43+
--data-urlencode "changelogurl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commits/${TAGNAME}" \
44+
--data-urlencode "altdownloadurl=${ZIPURL}" \
45+
--data-urlencode "releasenotes=${BODY}" \
46+
--data-urlencode "releasenotesformat=4")
47+
echo "::set-output name=response::${RESPONSE}"
48+
- name: Evaluate the response
49+
id: evaluate-response
50+
env:
51+
RESPONSE: ${{ steps.add-version.outputs.response }}
52+
run: |
53+
jq <<< ${RESPONSE}
54+
jq --exit-status ".id" <<< ${RESPONSE} > /dev/null

lib.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@
4141
* @return mixed True if module supports feature, false if not, null if doesn't know
4242
*/
4343
function groupmembers_supports($feature) {
44+
45+
if (defined('FEATURE_MOD_PURPOSE')) {
46+
if ($feature == FEATURE_MOD_PURPOSE) {
47+
return MOD_PURPOSE_ADMINISTRATION;
48+
}
49+
}
50+
4451
switch($feature) {
4552
case FEATURE_MOD_ARCHETYPE:
4653
return MOD_ARCHETYPE_RESOURCE;

version.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
defined('MOODLE_INTERNAL') || die();
2727

2828
$plugin->maturity = MATURITY_STABLE;
29-
$plugin->release = 'v3.11-r2';
29+
$plugin->release = 'v4.0-r1';
3030
$plugin->version = 2022042100; // The current module version (Date: YYYYMMDDXX).
31-
$plugin->requires = 2016120500; // Requires this Moodle version.
31+
$plugin->requires = 2020061500; // Requires this Moodle version.
3232
$plugin->component = 'mod_groupmembers'; // Full name of the plugin (used for diagnostics).

0 commit comments

Comments
 (0)