-
-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (103 loc) · 3.42 KB
/
ci.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: 🧪 Tests
on:
push:
tags:
- '*'
branches:
- '*'
paths:
- 'netads/**'
pull_request:
jobs:
unittests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .docker
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Launching docker-compose
run: ./start.sh with-qgis
- name: Running tests
run: ./exec_tests.sh
migration:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .docker
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Launching docker-compose
run: ./start.sh
- name: Running tests
run: ./install_migrate_generate.sh
flake8:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
architecture: x64
cache: "pip"
cache-dependency-path: "requirements/dev.txt"
- name: Install Python requirements
run: pip install -r requirements/dev.txt
- name: Run flake8
run: flake8 --statistics --show-source
packaging:
needs: [flake8, unittests, migration]
runs-on: ubuntu-latest
if: github.repository == '3liz/qgis-netads-plugin' && contains(github.ref, 'refs/tags/')
steps:
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "requirements/packaging.txt"
- name: Install Qt lrelease
run: |
sudo apt-get update
sudo apt-get install qttools5-dev-tools
- name: Install Python requirements
run: pip 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/release-action@v1.12.0
with:
bodyFile: release.md
token: ${{ secrets.BOT_HUB_TOKEN }}
- name: Package the plugin and deploy it in the release
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: Tweet
# uses: mugi111/tweet-trigger-release@v1.2
# with:
# consumer_key: ${{ secrets.TWITTER_CONSUMER_KEY }}
# consumer_secret: ${{ secrets.TWITTER_CONSUMER_SECRET }}
# access_token_key: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
# access_token_secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
# tweet_body: "Nouvelle version de NetADS ${{ env.RELEASE_VERSION }} 🗂 pour #QGIS https://github.com/3liz/qgis-netads-plugin/releases"
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.BOT_HUB_TOKEN }}
repository: 3liz/3liz.github.io
event-type: merge-plugins
client-payload: '{"name": "netads", "version": "${{ env.RELEASE_VERSION }}", "url": "https://github.com/3liz/qgis-netads-plugin/releases/latest/download/plugins.xml"}'