Merge pull request #579 from gkahiu/feature_metrics_framework #261
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Creating plugin package in main branch | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
create-package: | |
runs-on: ubuntu-22.04 | |
container: | |
image: qgis/qgis:release-3_34 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Fix Python command | |
run: apt-get install python-is-python3 | |
- name: Install python | |
uses: actions/setup-python@v4 | |
- name: Install plugin dependencies | |
run: pip install -r requirements-dev.txt | |
- name: Get unique identifier | |
id: get-identifier | |
run: | | |
echo "::set-output name=PACKAGE_ID::$(python -c "import uuid; print(str(uuid.uuid4())[:4])")" | |
- name: Generate zip file | |
run: | | |
python admin.py build --output-directory ${{ format( | |
'docs/plugin/package/cplus_plugin_main_{0}/cplus_plugin/', | |
steps.get-identifier.outputs.PACKAGE_ID) }} | |
- name: Plugin path details | |
id: get-zip-details | |
run: | | |
echo "::set-output name=ZIP_PATH::docs/plugin/package/$(ls docs/plugin/package)\n" | |
echo "::set-output name=ZIP_NAME::$(ls docs/plugin/package)" | |
- name: Uploading plugin build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ steps.get-zip-details.outputs.ZIP_NAME }} | |
path: ${{ steps.get-zip-details.outputs.ZIP_PATH }} | |
- name: Save the plugin folder name into artifact | |
shell: bash | |
env: | |
ZIP_FILE_NAME: ${{ steps.get-zip-details.outputs.ZIP_NAME }} | |
run: | | |
echo $ZIP_FILE_NAME > zip_file_name.txt | |
- name: Upload the zip file name | |
uses: actions/upload-artifact@v3 | |
with: | |
name: zip_file_name | |
path: ./zip_file_name.txt |