Skip to content

Commit

Permalink
CI - Update the infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Jun 8, 2021
1 parent 91df6b1 commit 55a09f2
Show file tree
Hide file tree
Showing 10 changed files with 113 additions and 53 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:

- package-ecosystem: "pip"
directory: "/requirements/"
schedule:
interval: "monthly"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
110 changes: 66 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ on:
- "*"
branches:
- master
# paths:
# - 'QuickOSM/**'
paths:
- 'QuickOSM/**'
pull_request:
branches:
- master
# paths:
# - 'QuickOSM/**'
paths:
- 'QuickOSM/**'

jobs:

Expand All @@ -32,12 +32,12 @@ jobs:
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python requirements
run: pip install -r requirements-dev.txt
run: pip install -r requirements/dev.txt

- name: Run flake8
run: flake8
Expand All @@ -64,41 +64,63 @@ jobs:
if: github.repository == '3liz/QuickOSM' && contains(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v2

- name: Install Qt lrelease
run: |
sudo apt-get update
sudo apt-get install qt5-default qttools5-dev-tools
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8

- name: Install qgis-plugin-ci
run: pip3 install qgis-plugin-ci==1.8.4

- name : Fetch current changelog
run: |
qgis-plugin-ci changelog ${GITHUB_REF/refs\/tags\//} >> release.md
cat release.md
- name: Create release on GitHub
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.BOT_HUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: release.md

- name: Package and deploy the zip
run: >-
qgis-plugin-ci
release ${GITHUB_REF/refs\/tags\//}
--github-token ${{ secrets.BOT_HUB_TOKEN }}
--transifex-token ${{ secrets.TRANSIFEX_TOKEN }}
--osgeo-username ${{ secrets.OSGEO_USERNAME }}
--osgeo-password ${{ secrets.OSGEO_PASSWORD }}
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- uses: actions/checkout@v2

- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8

- name: Install Qt lrelease
run: |
sudo apt-get update
sudo apt-get install qt5-default qttools5-dev-tools
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/release.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python requirements
run: pip install -r requirements/release.txt

- name : Fetch current changelog
run: qgis-plugin-ci changelog ${{ env.RELEASE_VERSION }} >> release.md

- name: Create release on GitHub
uses: ncipollo/[email protected]
with:
bodyFile: release.md
token: ${{ secrets.BOT_HUB_TOKEN }}

- name: Package and deploy the zip
run: >-
qgis-plugin-ci
release ${GITHUB_REF/refs\/tags\//}
--github-token ${{ secrets.BOT_HUB_TOKEN }}
--transifex-token ${{ secrets.TRANSIFEX_TOKEN }}
--osgeo-username ${{ secrets.OSGEO_USERNAME }}
--osgeo-password ${{ secrets.OSGEO_PASSWORD }}
--create-plugin-repo
- name: Tweet
uses: mugi111/[email protected]
with:
consumer_key: ${{ secrets.TWITTER_CONSUMER_KEY }}
consumer_secret: ${{ secrets.TWITTER_CONSUMER_SECRET }}
access_token_key: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
access_token_secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
tweet_body: "New version of #QuickOSM ${{ env.RELEASE_VERSION }} 🔎 for #QGIS https://github.com/3liz/QuickOSM/releases"

- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.BOT_HUB_TOKEN }}
repository: 3liz/3liz.github.io
event-type: merge-plugins
client-payload: '{"name": "QuickOSM", "version": "${{ env.RELEASE_VERSION }}", "url": "https://github.com/3liz/QuickOSM/releases/latest/download/plugins.xml"}'
7 changes: 5 additions & 2 deletions .github/workflows/publish-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ name: Documentation 📚

on:
push:
branches:
- master
paths:
- 'CHANGELOG.md'
- 'CONTRIBUTING.md'
- 'docs/**'
- 'mkdocs.yml'
- '.github/workflow/publish-doc.yml'

jobs:
deploy:
Expand All @@ -32,15 +35,15 @@ jobs:
uses: actions/[email protected]
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-doc.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/doc.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements-doc.txt
python -m pip install -r requirements/doc.txt
- name: Copy CHANGELOG.md and CONTRIBUTING.md
run: |
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/transifex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ name: Transifex 🗺

on:
push:
branches:
- master
paths:
- '**.py'
- '**.ui'


jobs:
push-transifex:
push:
name: Push to Transifex
runs-on: ubuntu-latest
if: github.repository == '3liz/QuickOSM'

steps:
- uses: actions/checkout@v2
Expand All @@ -17,8 +23,15 @@ jobs:
with:
python-version: 3.8

- name: Install qgis-plugin-ci
run: pip3 install qgis-plugin-ci==1.8.4
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/packaging.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python requirements
run: pip install -r requirements/packaging.txt

- name: Push to Transifex
run: qgis-plugin-ci push-translation ${{ secrets.TRANSIFEX_TOKEN }}
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ SQL and Python are covered by unittests with Docker.
[![Tests 🎳](https://github.com/3liz/QuickOSM/actions/workflows/ci.yml/badge.svg)](https://github.com/3liz/QuickOSM/actions/workflows/ci.yml)

```bash
pip install -r requirements-dev.txt
pip install -r requirements/dev.txt
flake8
make tests
```
Expand Down Expand Up @@ -55,7 +55,7 @@ plugins['QuickOSM'].run_tests()
The documentation is using [MkDocs](https://www.mkdocs.org/) with [Material](https://squidfunk.github.io/mkdocs-material/) :

```bash
pip install -r requirements-doc.txt
pip install -r requirements/doc.txt
mkdocs serve
```

Expand Down
10 changes: 9 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ nav:
- Contributing: contributing.md
- References: references.md

plugins:
- search
- git-revision-date-localized

markdown_extensions:
# - git-revision-date:
- toc:
permalink: "#"
- meta:
Expand All @@ -39,6 +42,7 @@ markdown_extensions:
- pymdownx.keys:
- attr_list:
- admonition:
- pymdownx.details:

extra_javascript:
- https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js
Expand All @@ -61,6 +65,7 @@ theme:
features:
- navigation.tabs
- navigation.tabs.sticky
- navigation.top

extra:
social:
Expand All @@ -75,3 +80,6 @@ extra:

- icon: fontawesome/brands/docker
link: https://hub.docker.com/u/3liz

- icon: fontawesome/brands/youtube
link: https://www.youtube.com/channel/UCYYW2CTWR_84kB6pt2zCWbQ
1 change: 0 additions & 1 deletion requirements-doc.txt

This file was deleted.

File renamed without changes.
2 changes: 2 additions & 0 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mkdocs-material>=7.0.0,<8.0.0
mkdocs-git-revision-date-localized-plugin
1 change: 1 addition & 0 deletions requirements/release.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
qgis-plugin-ci>=2.0.1,<2.1.0

0 comments on commit 55a09f2

Please sign in to comment.