Update statistics from Transifex #353
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests 🎳 | |
on: | |
push: | |
tags: | |
- "*" | |
branches: | |
- master | |
- dev | |
paths: | |
- 'QuickOSM/**' | |
pull_request: | |
branches: | |
- master | |
- dev | |
paths: | |
- 'QuickOSM/**' | |
jobs: | |
flake8: | |
name: Flake8 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
architecture: x64 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/cache@v4.0.2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/dev.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install Python requirements | |
run: pip install -r requirements/dev.txt | |
- name: Run flake8 | |
run: flake8 | |
# pylint: | |
# name: PyLint | |
# runs-on: ubuntu-latest | |
# steps: | |
# | |
# - name: Setup Python | |
# uses: actions/setup-python@v5 | |
# with: | |
# python-version: '3.10' | |
# architecture: x64 | |
# | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# | |
# - uses: actions/cache@v4.0.2 | |
# with: | |
# path: ~/.cache/pip | |
# key: ${{ runner.os }}-pip-${{ hashFiles('requirements/dev.txt') }} | |
# restore-keys: | | |
# ${{ runner.os }}-pip- | |
# | |
# - name: Install Python requirements | |
# run: pip install -r requirements/dev.txt | |
# | |
# - name: Run pylint | |
# run: pylint --rcfile=setup.cfg ./QuickOSM | |
test-qgis: | |
name: QGIS Desktop | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: .docker | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: Launching docker compose | |
run: ./start.sh | |
- name: Running tests | |
run: ./exec.sh | |
package-commit: | |
needs: [test-qgis, flake8] | |
name: Package commit | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# To fetch tags | |
fetch-depth: 0 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
cache: "pip" | |
cache-dependency-path: "requirements/packaging.txt" | |
# - name: Install Qt lrelease for translations | |
# 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 env | |
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 | |
- name: Package | |
run: >- | |
qgis-plugin-ci | |
package ${{ env.VERSION }} | |
- name: Unzip | |
run: unzip QuickOSM.${{ env.VERSION }}.zip -d tmp | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: QuickOSM.${{ env.VERSION }} | |
path: tmp | |
release: | |
needs: [test-qgis, flake8] | |
name: Package release | |
runs-on: ubuntu-latest | |
if: github.repository == '3liz/QuickOSM' && contains(github.ref, 'refs/tags/') | |
steps: | |
- name: Set env | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install Qt lrelease | |
run: | | |
sudo apt-get update | |
sudo apt-get install qttools5-dev-tools | |
- uses: actions/cache@v4.0.2 | |
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 : Fetch current changelog | |
run: qgis-plugin-ci changelog ${{ env.RELEASE_VERSION }} >> release.md | |
- name: Create release on GitHub | |
uses: ncipollo/release-action@v1.14.0 | |
with: | |
bodyFile: release.md | |
token: ${{ secrets.BOT_HUB_TOKEN }} | |
- name: Package and deploy the zip | |
run: >- | |
qgis-plugin-ci | |
release ${{ env.RELEASE_VERSION }} | |
--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 | |
# The previous step might fail on the OSGEO upload | |
if: failure() | |
uses: mugi111/tweet-trigger-release@v1.2 | |
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 | |
# The previous step might fail on the OSGEO upload | |
if: failure() | |
uses: peter-evans/repository-dispatch@v3 | |
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"}' |