-
-
Notifications
You must be signed in to change notification settings - Fork 41
103 lines (84 loc) · 2.85 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: 🚀 Release
on:
push:
tags:
- '*'
branches:
- master
pull_request:
branches:
- master
paths:
- 'cadastre/**'
jobs:
package-commit:
name: Package commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# To fetch tags
fetch-depth: 0
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: "pip"
cache-dependency-path: "requirements/packaging.txt"
- 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 cadastre.${{ env.VERSION }}.zip -d tmp
- uses: actions/upload-artifact@v4
with:
name: cadastre.${{ env.VERSION }}
path: tmp
package-release:
runs-on: ubuntu-latest
if: github.repository_owner == '3liz' && 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.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/[email protected]
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/packaging.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install qgis-plugin-ci
run: pip3 install -r requirements/packaging.txt
- name : Get current changelog
run: qgis-plugin-ci changelog ${{ env.RELEASE_VERSION }} >> release.md
- name: Create release on GitHub
uses: ncipollo/[email protected]
with:
bodyFile: release.md
token: ${{ secrets.BOT_HUB_TOKEN }}
- name: Deploy plugin
run: >-
qgis-plugin-ci
release ${{ env.RELEASE_VERSION }}
--github-token ${{ secrets.BOT_HUB_TOKEN }}
--osgeo-username ${{ secrets.OSGEO_USERNAME }}
--osgeo-password ${{ secrets.OSGEO_PASSWORD }}
--create-plugin-repo
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.BOT_HUB_TOKEN }}
repository: 3liz/3liz.github.io
event-type: merge-plugins
client-payload: '{"name": "cadastre", "version": "${{ env.RELEASE_VERSION }}", "url": "https://github.com/3liz/QgisCadastrePlugin/releases/latest/download/plugins.xml"}'