1
- name : " 📦 Packager "
1
+ name : " 📦 Packaging & 🚀 Release "
2
2
3
3
env :
4
4
PROJECT_FOLDER : " pyqgis_resource_browser"
7
7
on :
8
8
push :
9
9
branches : [main]
10
+ tags :
11
+ - " *"
12
+
13
+ pull_request :
14
+ branches : [main]
15
+ paths :
16
+ - .github/workflows/packager.yml
10
17
11
18
jobs :
19
+ translation :
20
+ name : " 💬 i18n compilation"
21
+ runs-on : ubuntu-latest
22
+
23
+ steps :
24
+ - name : Get source code
25
+ uses : actions/checkout@v3
26
+
27
+ - name : Install system requirements
28
+ run : |
29
+ sudo apt update
30
+ sudo apt install qt5-qmake qttools5-dev-tools
31
+
32
+ - name : Update translations
33
+ run : lupdate -noobsolete -verbose ${{ env.PROJECT_FOLDER }}/resources/i18n/plugin_translation.pro
34
+
35
+ - name : Compile translations
36
+ run : lrelease ${{ env.PROJECT_FOLDER }}/resources/i18n/*.ts
37
+
38
+ - uses : actions/upload-artifact@v3
39
+ with :
40
+ name : translations-build
41
+ path : ${{ env.PROJECT_FOLDER }}/**/*.qm
42
+ if-no-files-found : error
43
+
44
+ # -- NO TAGS ----------------------------------------------------------------------
12
45
packaging :
46
+ name : " 📦 Packaging plugin"
13
47
runs-on : ubuntu-latest
48
+ needs : [translation]
49
+
50
+ if : ${{ !startsWith(github.ref, 'refs/tags/') }}
14
51
15
52
steps :
16
53
- name : Checkout
@@ -19,25 +56,31 @@ jobs:
19
56
- name : Setup Python
20
57
uses : actions/setup-python@v4
21
58
with :
59
+ python-version : ${{ env.PYTHON_VERSION }}
22
60
cache : " pip"
23
61
cache-dependency-path : " requirements/packaging.txt"
24
- python-version : ${{ env.PYTHON_VERSION }}
25
-
26
- - name : Install system requirements
27
- run : |
28
- sudo apt update
29
- sudo apt install qt5-qmake qttools5-dev-tools
30
62
31
63
- name : Install project requirements
32
64
run : |
33
65
python -m pip install -U pip setuptools wheel
34
66
python -m pip install -U -r requirements/packaging.txt
35
67
36
- - name : Update translations
37
- run : pylupdate5 -noobsolete -verbose ${{ env.PROJECT_FOLDER }}/resources/i18n/plugin_translation.pro
68
+ - name : Download translations
69
+ uses : actions/download-artifact@v3
70
+ with :
71
+ name : translations-build
72
+ path : ${{ env.PROJECT_FOLDER }}
38
73
39
- - name : Compile translations
40
- run : lrelease ${{ env.PROJECT_FOLDER }}/resources/i18n/*.ts
74
+ - name : List files
75
+ run : tree ${{ env.PROJECT_FOLDER }}
76
+
77
+ - name : Amend gitignore to include compiled translations and add it to tracked files
78
+ run : |
79
+ # include compiled translations
80
+ sed -i "s|^*.qm.*| |" .gitignore
81
+
82
+ # git add full project
83
+ git add ${{ env.PROJECT_FOLDER }}/
41
84
42
85
- name : Package the latest version
43
86
run : qgis-plugin-ci package latest --allow-uncommitted-changes
47
90
name : ${{ env.PROJECT_FOLDER }}-latest
48
91
path : ${{ env.PROJECT_FOLDER }}.*.zip
49
92
if-no-files-found : error
93
+
94
+ # -- ONLY TAGS ----------------------------------------------------------------------
95
+ release :
96
+ name : " 🚀 Release on tag"
97
+ runs-on : ubuntu-latest
98
+ needs : [translation]
99
+
100
+ if : startsWith(github.ref, 'refs/tags/')
101
+
102
+ steps :
103
+ - name : Get tag name as version
104
+ id : get_version
105
+ run : echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
106
+
107
+ - name : Checkout
108
+ uses : actions/checkout@v3
109
+
110
+ - name : Setup Python
111
+ uses : actions/setup-python@v4
112
+ with :
113
+ python-version : ${{ env.PYTHON_VERSION }}
114
+ cache : " pip"
115
+ cache-dependency-path : " requirements/packaging.txt"
116
+
117
+ - name : Install project requirements
118
+ run : |
119
+ python -m pip install -U pip setuptools wheel
120
+ python -m pip install -U -r requirements/packaging.txt
121
+
122
+ - name : Download translations
123
+ uses : actions/download-artifact@v3
124
+ with :
125
+ name : translations-build
126
+ path : ${{ env.PROJECT_FOLDER }}
127
+
128
+ - name : Amend gitignore to include compiled translations and add it to tracked files
129
+ run : |
130
+ # include compiled translations
131
+ sed -i "s|^*.qm.*| |" .gitignore
132
+
133
+ # git add full project
134
+ git add ${{ env.PROJECT_FOLDER }}/
135
+
136
+ - name : Get current changelog for ${VERSION}
137
+ run : qgis-plugin-ci changelog ${GITHUB_REF/refs\/tags\//} >> release.md
138
+
139
+ - name : Create GitHub Release
140
+ uses : softprops/action-gh-release@v1
141
+ with :
142
+ fail_on_unmatched_files : true
143
+ bodyFile : release.md
144
+ generate_release_notes : true
145
+
146
+ - name : Deploy plugin
147
+ run : >-
148
+ qgis-plugin-ci
149
+ release ${GITHUB_REF/refs\/tags\//}
150
+ --allow-uncommitted-changes
151
+ --create-plugin-repo
152
+ --github-token ${{ secrets.GITHUB_TOKEN }}
153
+ --osgeo-username ${{ secrets.OSGEO_USER }}
154
+ --osgeo-password ${{ secrets.OSGEO_PASSWORD }}
0 commit comments