From 07f12d1b47daecf12265f7bb057cfd6f3bcf6542 Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Mon, 20 May 2024 10:11:36 +0100 Subject: [PATCH] Version bump 4.4 --- .github/workflows/moodle-release.yml | 66 ++++++++++++++++++++++++++++ CHANGELOG.md | 4 ++ version.php | 4 +- 3 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/moodle-release.yml diff --git a/.github/workflows/moodle-release.yml b/.github/workflows/moodle-release.yml new file mode 100644 index 0000000..41175dd --- /dev/null +++ b/.github/workflows/moodle-release.yml @@ -0,0 +1,66 @@ +# +# Whenever a new tag starting with "v" is pushed, add the tagged version +# to the Moodle Plugins directory at https://moodle.org/plugins +# +# revision: 2021070201 +# +name: Releasing in the Plugins directory + +on: + push: + tags: + - v* + + workflow_dispatch: + inputs: + tag: + description: 'Tag to be released' + required: true + +defaults: + run: + shell: bash + +jobs: + release-at-moodle-org: + runs-on: ubuntu-latest + env: + PLUGIN: tool_datewatch + CURL: curl -s + ENDPOINT: https://moodle.org/webservice/rest/server.php + TOKEN: ${{ secrets.MOODLE_ORG_TOKEN }} + FUNCTION: local_plugins_add_version + + steps: + - name: Call the service function + id: add-version + run: | + if [[ ! -z "${{ github.event.inputs.tag }}" ]]; then + TAGNAME="${{ github.event.inputs.tag }}" + elif [[ $GITHUB_REF = refs/tags/* ]]; then + TAGNAME="${GITHUB_REF##*/}" + fi + if [[ -z "${TAGNAME}" ]]; then + echo "No tag name has been provided!" + exit 1 + fi + ZIPURL="https://api.github.com/repos/${{ github.repository }}/zipball/${TAGNAME}" + RESPONSE=$(${CURL} ${ENDPOINT} --data-urlencode "wstoken=${TOKEN}" \ + --data-urlencode "wsfunction=${FUNCTION}" \ + --data-urlencode "moodlewsrestformat=json" \ + --data-urlencode "frankenstyle=${PLUGIN}" \ + --data-urlencode "zipurl=${ZIPURL}" \ + --data-urlencode "vcssystem=git" \ + --data-urlencode "vcsrepositoryurl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" \ + --data-urlencode "vcstag=${TAGNAME}" \ + --data-urlencode "changelogurl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commits/${TAGNAME}" \ + --data-urlencode "altdownloadurl=${ZIPURL}") + echo "response=${RESPONSE}" >> $GITHUB_OUTPUT + + - name: Evaluate the response + id: evaluate-response + env: + RESPONSE: ${{ steps.add-version.outputs.response }} + run: | + jq <<< ${RESPONSE} + jq --exit-status ".id" <<< ${RESPONSE} > /dev/null diff --git a/CHANGELOG.md b/CHANGELOG.md index b60df67..df7561a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 4.4 - 2024-05-21 +### Changed +- Only changes to the plugin release process + ## 4.3.4 - 2024-04-23 ### Added - Compatibility with Moodle 4.4, added to the testing matrix diff --git a/version.php b/version.php index 20dc993..f218481 100644 --- a/version.php +++ b/version.php @@ -25,8 +25,8 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'tool_datewatch'; -$plugin->release = '4.3.4'; -$plugin->version = 2024042300; +$plugin->release = '4.4'; +$plugin->version = 2024052100; $plugin->requires = 2020061500.00; $plugin->maturity = MATURITY_STABLE; $plugin->supported = [39, 404];