Skip to content

metadata.txt

metadata.txt #32

Workflow file for this run

name: Build plugin
on:
push:
branches:
- '*'
tags:
- '*'
workflow_dispatch:
inputs:
version:
description: 'Override plugin version for branch, default is short commit hash'
required: false
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Build plugin zip artifact
id: build
run: |
# makeBuild
# USAGE: ./makeBuild.sh $VERSION $folder_suffix
VERSION="${{ inputs.version }}"
if [[ "$GITHUB_REF_TYPE" == "branch" && "$GITHUB_EVENT_NAME" == "push" ]]; then
sha_short=$(git rev-parse --short HEAD)
VERSION=${VERSION:-"$sha_short"}
folder_suffix=DEV
echo "file_name=xyz-qgis-plugin-DEV" >> $GITHUB_OUTPUT
else
VERSION=${VERSION:-"$GITHUB_REF_NAME"}
echo "file_name=xyz-qgis-plugin" >> $GITHUB_OUTPUT
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "plugin_name=QGIS-XYZ-Plugin-$VERSION" >> $GITHUB_OUTPUT
chmod +x ./makeBuild.sh
./makeBuild.sh $VERSION $folder_suffix
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build.outputs.file_name }}
path: build/*.zip
- name: Release
uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag'
with:
files: |
build/*.zip