Skip to content

Commit

Permalink
initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBardian committed Aug 31, 2023
0 parents commit d10435c
Show file tree
Hide file tree
Showing 413 changed files with 52,264 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Backport
on:
pull_request_target:
types:
- closed
- labeled

jobs:
backport:
runs-on: ubuntu-latest
name: Backport
steps:
- name: Backport Bot
id: backport
if: github.event.pull_request.merged && ( ( github.event.action == 'closed' && contains( join( github.event.pull_request.labels.*.name ), 'backport') ) || contains( github.event.label.name, 'backport' ) )
uses: m-kuhn/backport@v1.2.7
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
124 changes: 124 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: Tests

on:
push:
branches:
- master
- ce
- lite

pull_request:
branches:
- master
- ce
- lite

workflow_dispatch:

jobs:
commit-sha:
name: Get Commit Hash
runs-on: ubuntu-latest

outputs:
commit_sha: ${{steps.get_hash.outputs.COMMIT_SHA}}

steps:
- name: Checkout Project
uses: actions/checkout@v3

- name: commit sha
id: get_hash
run: echo "::set-output name=COMMIT_SHA::$(git rev-parse --short HEAD)"

test:
name: Test on ${{matrix.container }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
container: ['qgis/qgis:release-3_22', 'qgis/qgis:release-3_24', 'qgis/qgis:release-3_26', 'qgis/qgis:release-3_28']

container: ${{ matrix.container }}

steps:

- name: Checkout Project
uses: actions/checkout@v3

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install pytest pytest-cov pytest-qt pytest-mock pytest-asyncio nest-asyncio
pip install -r requirements.txt
- name: Unit Tests
env:
DISPLAY: :99
run: |
xvfb-run qgis_testrunner.sh tests.run_tests.run_all
alembic-revision:
name: Generate SQL Scripts
needs: [test, commit-sha]
runs-on: ubuntu-latest

container: 'qgis/qgis:release-3_22'

steps:
- name: Checkout Project
uses: actions/checkout@v3

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install alembic
pip install -r requirements.txt
- name: Parse Alembic History
id: alembic_history
run: |
prev_revision=`alembic history | head -n1 | awk '{print $1}'`
revision_tag=`alembic history | head -n1 | awk '{print $NF}'`
prev_tag=`alembic history | head -n2 | tail -n1 | awk '{print $NF}'`
echo "::set-output name=prev_revision::$prev_revision"
echo "::set-output name=revision_tag::$revision_tag"
echo "::set-output name=prev_tag::$prev_tag"
- name: Generate Revisions
run: |
alembic upgrade head --sql > create_${{steps.alembic_history.outputs.revision_tag}}.sql
alembic downgrade head:${{steps.alembic_history.outputs.prev_revision}} --sql > downgrade_to_${{steps.alembic_history.outputs.prev_tag}}.sql
alembic upgrade ${{steps.alembic_history.outputs.prev_revision}}:head --sql > upgrade_from_${{steps.alembic_history.outputs.prev_tag}}.sql
- name: Upload SQL Scripts
uses: actions/upload-artifact@v2
with:
name: SAGis.XPlanung.sql-scripts@${{ needs.commit-sha.outputs.commit_sha }}
path: '*.sql'

publish:
name: Upload artifact
needs: [test, commit-sha]
runs-on: ubuntu-latest

steps:
- name: Checkout Project
uses: actions/checkout@v3

- name: copy source files and scripts
run: |
mkdir dist
cp -r src/SAGisXPlanung dist/XPlanung/
- uses: docker://pandoc/latex:2.9
with:
args: --from markdown -o dist/README.pdf README.md

- name: QGIS plugin distribution
uses: actions/upload-artifact@v2
with:
name: SAGis.XPlanung.source@${{ needs.commit-sha.outputs.commit_sha }}
path: ./dist
94 changes: 94 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: windows-latest
outputs:
upload_url: ${{ steps.create-release.outputs.upload_url }}
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Get Version Number
id: get_version_number
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
shell: bash

- name: Pack Assets
id: pack_assets
run: |
Compress-Archive .\SAGisXPlanung SAGis.XPlanung_${{ steps.get_version_number.outputs.VERSION }}.zip
working-directory: src

- name: Create Installer
id: create_installer
run: |
Copy-Item -Path "..\src\SAGisXPlanung" -Destination . -Recurse
python3 -m pip download sqlalchemy==1.4.46 GeoAlchemy2 qasync shapely==2.0.0 lxml asyncpg --dest dependencies
iscc.exe /DSAGIS_VERSION=${{ steps.get_version_number.outputs.VERSION }} "setup.iss"
iscc.exe /DSAGIS_VERSION=${{ steps.get_version_number.outputs.VERSION }} /DWITH_CIVIL_IMPORT "setup.iss"
working-directory: installer

- name: Create Release
id: create-release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref }}
name: Release ${{ steps.get_version_number.outputs.VERSION }}
body: ""
prerelease: false
files: |
src/SAGis.XPlanung_${{ steps.get_version_number.outputs.VERSION }}.zip
installer/Output/*.exe
alembic-revision:
name: Generate SQL Scripts
needs: [build]
runs-on: ubuntu-latest

container: 'qgis/qgis:release-3_28'

steps:
- name: Checkout Project
uses: actions/checkout@v3

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install alembic
pip install -r requirements.txt
- name: Parse Alembic History
id: alembic_history
run: |
prev_revision=`alembic history | head -n1 | awk '{print $1}'`
revision_tag=`alembic history | head -n1 | awk '{print $NF}'`
prev_tag=`alembic history | head -n2 | tail -n1 | awk '{print $NF}'`
echo "::set-output name=prev_revision::$prev_revision"
echo "::set-output name=revision_tag::$revision_tag"
echo "::set-output name=prev_tag::$prev_tag"
- name: Generate Revisions
run: |
alembic upgrade head --sql > create_${{steps.alembic_history.outputs.revision_tag}}.sql
alembic downgrade head:${{steps.alembic_history.outputs.prev_revision}} --sql > downgrade_to_${{steps.alembic_history.outputs.prev_tag}}.sql
alembic upgrade ${{steps.alembic_history.outputs.prev_revision}}:head --sql > upgrade_from_${{steps.alembic_history.outputs.prev_tag}}.sql
- name: Package Files
run: |
apt-get install zip
zip -R sql_scripts.zip *.sql
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.build.outputs.upload_url }}
asset_path: ./sql_scripts.zip
asset_name: sql_scripts.zip
asset_content_type: application/zip
143 changes: 143 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# pycharm
.idea/

installer/*/

0 comments on commit d10435c

Please sign in to comment.