Skip to content

Commit 47301b3

Browse files
authored
Merge pull request #22 from Guts/ci/add-gh-workflow-to-package-on-main
add(ci): GitHub workflow to package plugin on CI/CD
2 parents 907756f + 4f496b2 commit 47301b3

File tree

3 files changed

+200
-32
lines changed

3 files changed

+200
-32
lines changed

.github/workflows/packager.yml

+183
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
name: "📦 Packaging & 🚀 Release"
2+
3+
env:
4+
PROJECT_FOLDER: "profile_manager"
5+
PYTHON_VERSION: 3.9
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
tags:
12+
- "*"
13+
14+
pull_request:
15+
branches:
16+
- main
17+
paths:
18+
- .github/workflows/packager.yml
19+
- requirements/packaging.txt
20+
- profile_manager/**/*
21+
22+
# Allow one concurrent deployment per branch/pr
23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
25+
cancel-in-progress: true
26+
27+
jobs:
28+
translation:
29+
name: "💬 i18n compilation"
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- name: Get source code
34+
uses: actions/checkout@v4
35+
36+
- name: Setup Python
37+
uses: actions/setup-python@v5
38+
with:
39+
python-version: ${{ env.PYTHON_VERSION }}
40+
cache: "pip"
41+
42+
- name: Install system requirements
43+
run: |
44+
sudo apt update
45+
sudo apt install qt5-qmake qttools5-dev-tools
46+
python3 -m pip install -U pyqt5-tools
47+
48+
- name: Update translations
49+
run: pylupdate5 -noobsolete -verbose ${{ env.PROJECT_FOLDER }}/resources/i18n/plugin_translation.pro
50+
51+
- name: Compile translations
52+
run: lrelease ${{ env.PROJECT_FOLDER }}/resources/i18n/*.ts
53+
54+
- uses: actions/upload-artifact@v4
55+
with:
56+
name: translations-build
57+
path: ${{ env.PROJECT_FOLDER }}/**/*.qm
58+
if-no-files-found: error
59+
60+
# -- NO TAGS ----------------------------------------------------------------------
61+
packaging:
62+
name: "📦 Packaging plugin"
63+
runs-on: ubuntu-latest
64+
needs:
65+
- translation
66+
67+
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
68+
69+
steps:
70+
- name: Checkout
71+
uses: actions/checkout@v4
72+
73+
- name: Setup Python
74+
uses: actions/setup-python@v5
75+
with:
76+
python-version: ${{ env.PYTHON_VERSION }}
77+
cache: "pip"
78+
cache-dependency-path: "requirements/packaging.txt"
79+
80+
- name: Install project requirements
81+
run: |
82+
python -m pip install -U pip setuptools wheel
83+
python -m pip install -U -r requirements/packaging.txt
84+
85+
- name: Download translations
86+
uses: actions/download-artifact@v4
87+
with:
88+
name: translations-build
89+
path: ${{ env.PROJECT_FOLDER }}
90+
91+
- name: List files
92+
run: tree ${{ env.PROJECT_FOLDER }}
93+
94+
- name: Amend gitignore to include compiled translations and add it to tracked files
95+
run: |
96+
# include compiled translations
97+
sed -i "s|^*.qm.*| |" .gitignore
98+
99+
# include LICENSE file since it's mandatory
100+
cp LICENSE ${{ env.PROJECT_FOLDER }}/
101+
sed -i "s|^${{ env.PROJECT_FOLDER }}/LICENSE| |" .gitignore
102+
103+
# git add full project
104+
git add ${{ env.PROJECT_FOLDER }}/
105+
106+
- name: Package the latest version
107+
env:
108+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109+
run: |
110+
qgis-plugin-ci package latest \
111+
--allow-uncommitted-changes \
112+
--plugin-repo-url $(gh api "repos/$GITHUB_REPOSITORY/pages" --jq '.html_url')
113+
114+
- uses: actions/upload-artifact@v4
115+
with:
116+
name: ${{ env.PROJECT_FOLDER }}-latest
117+
path: |
118+
plugins.xml
119+
${{ env.PROJECT_FOLDER }}.*.zip
120+
if-no-files-found: error
121+
122+
# -- ONLY TAGS ----------------------------------------------------------------------
123+
release:
124+
name: "🚀 Release on tag"
125+
runs-on: ubuntu-latest
126+
needs:
127+
- translation
128+
129+
if: startsWith(github.ref, 'refs/tags/')
130+
131+
steps:
132+
- name: Get tag name as version
133+
id: get_version
134+
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
135+
136+
- name: Checkout
137+
uses: actions/checkout@v4
138+
139+
- name: Setup Python
140+
uses: actions/setup-python@v5
141+
with:
142+
python-version: ${{ env.PYTHON_VERSION }}
143+
cache: "pip"
144+
cache-dependency-path: "requirements/packaging.txt"
145+
146+
- name: Install project requirements
147+
run: |
148+
python -m pip install -U pip setuptools wheel
149+
python -m pip install -U -r requirements/packaging.txt
150+
151+
- name: Download translations
152+
uses: actions/download-artifact@v4
153+
with:
154+
name: translations-build
155+
path: ${{ env.PROJECT_FOLDER }}
156+
157+
- name: Amend gitignore to include compiled translations and add it to tracked files
158+
run: |
159+
# include compiled translations
160+
sed -i "s|^*.qm.*| |" .gitignore
161+
162+
# include LICENSE file since it's mandatory
163+
cp LICENSE ${{ env.PROJECT_FOLDER }}/
164+
sed -i "s|^${{ env.PROJECT_FOLDER }}/LICENSE| |" .gitignore
165+
166+
# git add full project
167+
git add ${{ env.PROJECT_FOLDER }}/
168+
169+
- name: Create GitHub Release
170+
uses: softprops/action-gh-release@v2
171+
with:
172+
fail_on_unmatched_files: true
173+
generate_release_notes: true
174+
175+
- name: Deploy plugin
176+
run: >-
177+
qgis-plugin-ci
178+
release ${GITHUB_REF/refs\/tags\//}
179+
--allow-uncommitted-changes
180+
--create-plugin-repo
181+
--github-token ${{ secrets.GITHUB_TOKEN }}
182+
--osgeo-username ${{ secrets.OSGEO_USER }}
183+
--osgeo-password ${{ secrets.OSGEO_PASSWORD }}

CHANGELOG.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ Unreleased
1616
1717
-->
1818

19-
## Version 0.5.0-beta1 - 2024-10-04
19+
## 0.5.0-beta1 - 2024-10-04
2020

2121
- add modern plugin's packaging using QGIS Plugin CI
2222
- apply Python coding rules to whole codebase (PEP8)
2323
- remove dead code
2424
- add Git hooks and quality tooling
2525
- ships the big refactoring started in 2023
2626

27-
## Version 0.4 - 2023-06-29
27+
## 0.4 - 2023-06-29
2828

2929
- Fairly big refactoring and cleanup
3030
- Better and more verbose error handling
@@ -34,19 +34,19 @@ Unreleased
3434
- Add support for Vector Tiles connections
3535
- Fix a crash (thanks Ivano Giuliano!)
3636

37-
## Version 0.31 - 2022-07-31
37+
## 0.31 - 2022-07-31
3838

3939
- Update metadata
4040

41-
## Version 0.3 - 2022-07-13
41+
## 0.3 - 2022-07-13
4242

4343
- Fix scanning for bookmarks, favourites, exp functions, styles
4444

45-
## Version 0.21 - 2022-01-18
45+
## 0.21 - 2022-01-18
4646

4747
- Add support for BSD and other Unixes (thanks Loïc Bartoletti!)
4848
- Add Italy - German translation (thanks Salvatore Fiandaca!)
4949

50-
## Version 0.2 - 2022-01-12
50+
## 0.2 - 2022-01-12
5151

5252
- First public release

profile_manager/metadata.txt

+11-26
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,26 @@
11
[general]
22
name=Profile Manager
3-
qgisMinimumVersion=3.12
43
description=Makes handling profiles easy by giving you an UI to easily import settings from one profile to another
54
about=A QGIS Plugin that provides an UI to easily manage your profiles and import various settings from one profile to another
6-
version=0.4
7-
author=WhereGroup GmbH
8-
9-
repository=https://github.com/WhereGroup/profile-manager/
10-
# End of mandatory metadata
11-
12-
homepage=https://wheregroup.com/
135
category=Plugins
146
tags=profilemanager, manager, profiles, python
157
icon=icon.png
8+
9+
# credits and contact
10+
author=WhereGroup GmbH
11+
12+
homepage=https://wheregroup.com/
13+
repository=https://github.com/WhereGroup/profile-manager/
1614
tracker=https://github.com/WhereGroup/profile-manager/issues
1715

16+
# QGIS extensions manager flags
1817
deprecated=False
1918
experimental=True
2019
hasProcessingProvider=no
20+
qgisMinimumVersion=3.12
21+
qgisMaximumVersion=3.99
2122
server=False
2223

24+
# versioning
25+
version=0.5.0-beta1
2326
changelog=
24-
Version 0.4:
25-
- Fairly big refactoring and cleanup
26-
- Better and more verbose error handling
27-
- Improve performance
28-
- Reduce backup size, change backup directory
29-
- Improve dialogs and messages
30-
- Add support for Vector Tiles connections
31-
- Fix a crash (thanks Ivano Giuliano!)
32-
- ...
33-
Version 0.31:
34-
- Update metadata
35-
Version 0.3:
36-
- Fix scanning for bookmarks, favourites, exp functions, styles
37-
Version 0.21:
38-
- Add support for BSD and other Unixes (thanks Loïc Bartoletti!)
39-
- Add Italy - German translation (thanks Salvatore Fiandaca!)
40-
Version 0.2:
41-
- First public release

0 commit comments

Comments
 (0)