Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial CI workflow files #78

Merged
merged 4 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Continuous Integration

on:
push:
branches:
- main
pull_request:
branches:
- main

env:
TZ: UTC

jobs:
ci:
runs-on: ubuntu-22.04
container:
image: qgis/qgis:ltr
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: fix Python command
run: apt-get install python-is-python3

- name: Install poetry
uses: Gr1N/setup-poetry@v9

- name: Install dependencies
run: poetry install --without gdal

- name: Rebuild docs
run: poetry run mkdocs build

- name: Regenerate plugin repo XML
run: poetry run pluginadmin --verbose generate-plugin-repo-xml

publish-docs:
needs: ci
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-22.04
container:
image: qgis/qgis:ltr
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: fix Python command
run: apt-get install python-is-python3

- name: Install poetry
uses: Gr1N/setup-poetry@v9

- name: Install pluginadmin dependencies
run: poetry install --without gdal

- name: generate plugin repo XML
run: poetry run python pluginadmin.py --verbose generate-plugin-repo-xml

- name: update docs
run: poetry run mkdocs gh-deploy --force
76 changes: 76 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Create a release
on:
push:
tags:
- "v*"

env:
TZ: UTC

jobs:
create-release:
runs-on: ubuntu-22.04
container:
image: qgis/qgis:ltr
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: fix Python command
run: apt-get install python-is-python3

- name: Install poetry
uses: Gr1N/setup-poetry@v9

- name: Install pluginadmin dependencies
run: poetry install --without gdal

- name: Get experimental info
id: get-experimental
run: |
echo "::set-output name=IS_EXPERIMENTAL::$(poetry run python -c "import toml; data=toml.load('pyproject.toml'); print(data['tool']['qgis-plugin']['metadata']['experimental'].lower())")"

- name: generate zip
run: poetry run python pluginadmin generate-zip

- name: get zip details
id: get-zip-details
run: |
echo "::set-output name=ZIP_PATH::dist/$(ls dist)\n"
echo "::set-output name=ZIP_NAME::$(ls dist)"

- name: create release from tag
id: create-release
uses: softprops/action-gh-release@v2
with:
name: Release ${{ github.ref }}
tag_name: ${{ github.ref }}
prerelease: ${{ steps.get-experimental.outputs.IS_EXPERIMENTAL }}
body_path: ${{ github.workspace }}/CHANGELOG.md
draft: false
files: ${{ steps.get-zip-details.outputs.ZIP_PATH }}
token: ${{ github.token }}

update-docs:
needs: create-release
runs-on: ubuntu-22.04
container:
image: qgis/qgis:ltr
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: fix Python command
run: apt-get install python-is-python3

- name: Install poetry
uses: Gr1N/setup-poetry@v9

- name: Install pluginadmin dependencies
run: poetry install --without gdal

- name: generate plugin repo XML
run: poetry run pluginadmin --verbose generate-plugin-repo-xml

- name: update docs
run: poetry run mkdocs gh-deploy --force
4 changes: 2 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ rich = "^13.7.1"
toml = "^0.10.2"
httpx = "^0.27.0"
pyyaml = "^6.0.1"
gdal = "3.8.4"
psycopg2-binary = "^2.9.9"
mkdocs = "^1.6.0"
mkdocs-material = "^9.5.29"
pymdown-extensions = "^10.8.1"

[tool.poetry.group.gdal]

[tool.poetry.group.gdal.dependencies]
gdal = "3.8.4"

[tool.poetry.scripts]
pluginadmin = "plugindev.pluginadmin:app"

Expand Down