Skip to content

Commit b7581fb

Browse files
author
Matthias Kollenbroich
committed
Updated workflows
1 parent c6a2431 commit b7581fb

File tree

1 file changed

+8
-46
lines changed

1 file changed

+8
-46
lines changed

.github/workflows/moodle-release.yml

Lines changed: 8 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,15 @@
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-
# Changed to be released on Github release with the release notes.
6-
#
7-
name: Releasing in the Plugins directory
1+
name: Moodle Plugin Release
2+
3+
########################################################################################################################
84

95
on:
106
release:
117
types: [published]
128

13-
defaults:
14-
run:
15-
shell: bash
9+
########################################################################################################################
1610

1711
jobs:
18-
release-at-moodle-org:
19-
runs-on: ubuntu-latest
20-
env:
21-
PLUGIN: local_chunkupload
22-
CURL: curl -s
23-
ENDPOINT: https://moodle.org/webservice/rest/server.php
24-
TOKEN: ${{ secrets.MOODLE_ORG_TOKEN }}
25-
FUNCTION: local_plugins_add_version
26-
27-
steps:
28-
- name: Call the service function
29-
id: add-version
30-
run: |
31-
TAGNAME="${{ github.event.release.tag_name }}"
32-
BODY="${{ github.event.release.body }}"
33-
ZIPURL="${{ github.event.release.zipball_url }}"
34-
RESPONSE=$(${CURL} ${ENDPOINT} --data-urlencode "wstoken=${TOKEN}" \
35-
--data-urlencode "wsfunction=${FUNCTION}" \
36-
--data-urlencode "moodlewsrestformat=json" \
37-
--data-urlencode "frankenstyle=${PLUGIN}" \
38-
--data-urlencode "zipurl=${ZIPURL}" \
39-
--data-urlencode "vcssystem=git" \
40-
--data-urlencode "vcsrepositoryurl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" \
41-
--data-urlencode "vcstag=${TAGNAME}" \
42-
--data-urlencode "changelogurl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commits/${TAGNAME}" \
43-
--data-urlencode "altdownloadurl=${ZIPURL}" \
44-
--data-urlencode "releasenotes=${BODY}" \
45-
--data-urlencode "releasenotesformat=4")
46-
echo "response=${RESPONSE}" >> $GITHUB_OUTPUT
47-
- name: Evaluate the response
48-
id: evaluate-response
49-
env:
50-
RESPONSE: ${{ steps.add-version.outputs.response }}
51-
run: |
52-
jq <<< ${RESPONSE}
53-
jq --exit-status ".id" <<< ${RESPONSE} > /dev/null
12+
call-moodle-release-workflow:
13+
uses: Opencast-Moodle/moodle-workflows-opencast/.github/workflows/moodle-release.yml@master
14+
with:
15+
plugin-name: 'local_chunkupload'

0 commit comments

Comments
 (0)