omeka-s-developer
omeka-s-developer copied to clipboard
Module documentation enhancement
Github now allows you to use actions that could create a release and attach a zipped version of the module for you. Putting an example action in the documentation (docs/register_an_addon.md
) might be very helpful. Here is the one I use for the Any Cloud module. You create a tag with the version of the module you want to create a release for (v2.2.3 for example) and the action takes over from there:
.github/workflows/release.yml
name: Release
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: "Checkout repository"
uses: "actions/checkout@master"
- name: "Set up PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "latest"
- name: "Composer install"
uses: "ramsey/composer-install@v2"
with:
composer-options: "--ignore-platform-reqs --optimize-autoloader"
- name: "Create archive release"
uses: "thedoctor0/zip-release@master"
with:
filename: "{AddonZipName}.zip"
exclusions: "*.git* .tx/ language/*.po* .editorconfig phpcs.xml.dist"
- name: Upload Release
uses: ncipollo/release-action@v1
with:
artifacts: '{AddonZipName}.zip'
bodyFile: "RELEASE.md"
token: ${{ secrets.GITHUB_TOKEN }}
It downloads composer, installs the versions of the dependencies indicated in your composer.lock
file in the repository, zips everything up except what you put in the exclusions
section, and adds the text of RELEASE.md
as the text of the release.
In any case, this might be helpful to other developers and make things a little easier than manually uploaded a .zip
file to every release. Creating a git
tag for a release and letting GitHub do all the other work is really helpful.