Skip to content

Commit

Permalink
fix automatic maturity level setting on release
Browse files Browse the repository at this point in the history
  • Loading branch information
Glutamat42 committed Dec 4, 2024
1 parent a988536 commit c504746
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
# - release is marked as pre-release on github, then MATURITY_BETA
# - release name contains 'rc', then MATURITY_RC
if [[ "${{ github.ref_name }}" == *"rc"* ]]; then
sed -i "s/^\$plugin->maturity\s=\sMATURITY_STABLE;/\$plugin->maturity = MATURITY_RC;/" version.php
sed -i "s/^\$plugin->maturity\s=\sMATURITY_[A-Z]*;/\$plugin->maturity = MATURITY_RC;/" version.php
elif [[ "${{ github.event_name }}" == "release" && "${{ github.event.release.prerelease }}" == "true" ]]; then
sed -i "s/^\$plugin->maturity\s=\sMATURITY_STABLE;/\$plugin->maturity = MATURITY_BETA;/" version.php
else
sed -i "s/^\$plugin->maturity\s=\sMATURITY_STABLE;/\$plugin->maturity = MATURITY_STABLE;/" version.php
sed -i "s/^\$plugin->maturity\s=\sMATURITY_[A-Z]*;/\$plugin->maturity = MATURITY_BETA;/" version.php
else
sed -i "s/^\$plugin->maturity\s=\sMATURITY_[A-Z]*;/\$plugin->maturity = MATURITY_STABLE;/" version.php
fi
- name: remove files not needed for release
Expand All @@ -45,28 +45,24 @@ jobs:
md5sum /tmp/moodle-${{ env.PLUGIN_NAME }}-${{ github.ref_name }}.tgz > /tmp/moodle-${{ env.PLUGIN_NAME }}-${{ github.ref_name }}.tgz.md5
md5sum /tmp/moodle-${{ env.PLUGIN_NAME }}-${{ github.ref_name }}.zip > /tmp/moodle-${{ env.PLUGIN_NAME }}-${{ github.ref_name }}.zip.md5
- name: Upload release archive (ZIP)
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /tmp/moodle-${{ env.PLUGIN_NAME }}-${{ github.ref_name }}.zip
tag: ${{ github.ref_name }}

- name: Upload release archive (TGZ)
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /tmp/moodle-${{ env.PLUGIN_NAME }}-${{ github.ref_name }}.tgz
tag: ${{ github.ref_name }}

- name: Upload MD5 hash files (ZIP)
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /tmp/moodle-${{ env.PLUGIN_NAME }}-${{ github.ref_name }}.zip.md5
tag: ${{ github.ref_name }}

- name: Upload MD5 hash files (TGZ)
uses: svenstaro/upload-release-action@v2
with:
Expand Down

0 comments on commit c504746

Please sign in to comment.