Skip to content

Commit

Permalink
Add build.yml and requirements.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
merydian authored and nyalldawson committed May 9, 2024
1 parent 4a53163 commit e8a2e11
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build

on: push

jobs:
build:
name: "Build"
runs-on: ubuntu-latest

steps:
- name: Get source code
uses: actions/checkout@v4
with:
# To fetch tags
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "requirements/packaging.txt"

# - name: Install Qt lrelease
# run: |
# sudo apt-get update
# sudo apt-get install qttools5-dev-tools

- name: Install Python requirements
run: pip install -r requirements/packaging.txt

- name: Set plugin version environment variables
run: |
TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "VERSION=$(echo ${TAG} | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{if(length($NF+1)>length($NF))$(NF-1)++; $NF=sprintf("%0*d", length($NF), ($NF+1)%(10^length($NF))); print}')-alpha" >> $GITHUB_ENV
echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Build package
run: |
qgis-plugin-ci --no-validation package ${{ env.VERSION }}
mkdir tmp
unzip firstaid.${{ env.VERSION }}.zip -d tmp
- uses: actions/upload-artifact@v2
with:
name: firstaid_plugin.${{ env.VERSION }}.${{ env.SHA_SHORT }}
path: tmp
1 change: 1 addition & 0 deletions requirements/packaging.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
qgis-plugin-ci>=2.7.0

0 comments on commit e8a2e11

Please sign in to comment.