Package libqfieldsync as wheel #689
Workflow file for this run
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: Continuous integration | |
on: | |
push: | |
branches: | |
- master | |
- release-** | |
pull_request: | |
branches: | |
- '**' | |
release: | |
types: ['prereleased', 'released'] | |
workflow_dispatch: | |
inputs: | |
ref: | |
description: Branch or SHA to checkout | |
required: true | |
default: 'master' | |
jobs: | |
code_check: | |
name: Code check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Setup Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.8 | |
- name: Install pipenv | |
run: pip install pipenv | |
- name: Check code formatting | |
run: | | |
pipenv install pre_commit | |
pipenv run python -m pre_commit run --all-files | |
# Run unit tests | |
test: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
qgis_version: [release-3_22, latest] | |
env: | |
QGIS_TEST_VERSION: ${{ matrix.qgis_version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Test | |
run: | | |
docker-compose -f .docker/docker-compose.gh.yml run qgis /usr/src/.docker/run-docker-tests.sh | |
test-22-04: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Test | |
run: | | |
wget -qO - https://qgis.org/downloads/qgis-2022.gpg.key | sudo gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/qgis-archive.gpg --import | |
sudo chmod a+r /etc/apt/trusted.gpg.d/qgis-archive.gpg | |
sudo add-apt-repository "deb https://qgis.org/ubuntu $(lsb_release -c -s) main" | |
sudo apt update | |
sudo apt install qgis | |
sudo pip3 install --upgrade pip | |
sudo pip3 install pytest nose2 mock | |
pip3 install -r requirements.txt | |
xvfb-run pytest | |
release: | |
runs-on: ubuntu-22.04 | |
env: | |
OSGEO_USERNAME: mkuhn | |
OSGEO_PASSWORD: ${{ secrets.OSGEO_PASSWORD }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TX_TOKEN: ${{ secrets.TX_TOKEN }} | |
GITHUB_REF: ${{ github.ref }} | |
if: ${{ github.event_name == 'release' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Install dependencies | |
run: | | |
sudo apt update && sudo apt install qtbase5-dev qttools5-dev-tools | |
sudo pip install qgis-plugin-ci | |
- name: Package libqfieldsync | |
run: | | |
pip wheel $(grep -o -P '(https://.*.tar.gz)' requirements.txt) | |
mv libqfieldsync-*.whl qfieldsync/libqfieldsync.whl | |
- name: Release | |
run: | | |
RELEASE_VERSION=${GITHUB_REF##*/} | |
RELEASE_TAG=${GITHUB_REF##*/} | |
qgis-plugin-ci release ${RELEASE_VERSION} \ | |
--release-tag ${RELEASE_TAG} \ | |
--transifex-token ${TX_TOKEN} \ | |
--github-token ${GITHUB_TOKEN} \ | |
--osgeo-username ${OSGEO_USERNAME} \ | |
--osgeo-password ${OSGEO_PASSWORD} \ | |
--asset-path qfieldsync/libqfieldsync.whl | |
package: | |
runs-on: ubuntu-22.04 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TX_TOKEN: ${{ secrets.TX_TOKEN }} | |
GITHUB_REF: ${{ github.ref }} | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
ref: ${{ github.event.inputs.ref }} | |
- name: Install dependencies | |
run: | | |
sudo apt update && sudo apt install qtbase5-dev qttools5-dev-tools | |
sudo pip install qgis-plugin-ci | |
- name: Release | |
run: | | |
qgis-plugin-ci package ${{ github.event.inputs.ref }} --transifex-token ${TX_TOKEN} | |
- name: Upload release assets | |
uses: actions/upload-artifact@v2 | |
with: | |
name: qfieldsync.${{ github.event.inputs.ref }}.zip | |
path: ./qfieldsync.${{ github.event.inputs.ref }}.zip | |
translations: | |
runs-on: ubuntu-22.04 | |
env: | |
TX_TOKEN: ${{ secrets.TX_TOKEN }} | |
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Install dependencies | |
run: sudo pip install qgis-plugin-ci | |
- name: 🌍 Push translations | |
run: | | |
qgis-plugin-ci push-translation ${TX_TOKEN} |