Skip to content

chore(deps): bump actions/setup-python from 5 to 6 (#57) #4

chore(deps): bump actions/setup-python from 5 to 6 (#57)

chore(deps): bump actions/setup-python from 5 to 6 (#57) #4

name: "πŸ“¦ Package & πŸš€ Release"
env:
PROJECT_FOLDER: plugin_map2loop
PYTHON_VERSION: 3.9
on:
push:
branches:
- main
paths:
- .github/workflows/package_and_release.yml
- 'docs/**/*'
- "plugin_map2loop/**/*.py"
- "plugin_map2loop/metadata.txt"
tags:
- "*"
# Allow one concurrent deployment per branch/pr
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
translation:
name: "πŸ’¬ i18n compilation"
runs-on: ubuntu-latest
steps:
- name: Get source code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install translation requirements
run: |
sudo apt update
sudo apt install qt5-qmake qttools5-dev-tools
python3 -m pip install -U pyqt5-tools
- name: Update translations
run: |
python3 scripts/generate_translation_profile.py
pylupdate5 -noobsolete -verbose ${{ env.PROJECT_FOLDER }}/resources/i18n/plugin_translation.pro
- name: Compile translations
run: lrelease ${{ env.PROJECT_FOLDER }}/resources/i18n/*.ts
- uses: actions/upload-artifact@v5
with:
name: translations-build
path: ${{ env.PROJECT_FOLDER }}/**/*.qm
if-no-files-found: error
# -- NO TAGS ----------------------------------------------------------------------
packaging:
name: "πŸ“¦ Packaging plugin"
runs-on: ubuntu-latest
needs:
- translation
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v6
with:
cache: "pip"
cache-dependency-path: "requirements/packaging.txt"
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: |
python -m pip install -U pip setuptools wheel
python -m pip install -U -r requirements/packaging.txt
- name: Download translations
uses: actions/download-artifact@v6
with:
name: translations-build
path: ${{ env.PROJECT_FOLDER }}
- name: Amend gitignore to include compiled translations and add it to tracked files
run: |
# include compiled translations
sed -i "s|^*.qm.*| |" .gitignore
# git add full project
git add ${{ env.PROJECT_FOLDER }}/
- name: Package the latest version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
qgis-plugin-ci package latest \
--allow-uncommitted-changes \
--plugin-repo-url $(gh api "repos/$GITHUB_REPOSITORY/pages" --jq '.html_url')
- uses: actions/upload-artifact@v5
with:
name: ${{ env.PROJECT_FOLDER }}-latest
path: |
plugins.xml
${{ env.PROJECT_FOLDER }}.*.zip
if-no-files-found: error
# -- ONLY TAGS ----------------------------------------------------------------------
release:
name: "πŸš€ Release on tag"
runs-on: ubuntu-latest
permissions:
contents: write
needs:
- translation
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v6
with:
cache: "pip"
cache-dependency-path: "requirements/packaging.txt"
python-version: ${{ env.PYTHON_VERSION }}
- name: Install project requirements
run: |
python -m pip install -U pip setuptools wheel
python -m pip install -U -r requirements/packaging.txt
- name: Download translations
uses: actions/download-artifact@v6
with:
name: translations-build
path: ${{ env.PROJECT_FOLDER }}
- name: Amend gitignore to include compiled translations and add it to tracked files
run: |
# include compiled translations
sed -i "s|^*.qm.*| |" .gitignore
# git add full project
git add ${{ env.PROJECT_FOLDER }}/
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
fail_on_unmatched_files: true
generate_release_notes: true
- name: Deploy plugin
run: >-
qgis-plugin-ci
release ${GITHUB_REF/refs\/tags\//}
--allow-uncommitted-changes
--create-plugin-repo
--github-token ${{ secrets.GITHUB_TOKEN }}
--osgeo-username ${{ secrets.OSGEO_USER }}
--osgeo-password ${{ secrets.OSGEO_PASSWORD }}