-
Notifications
You must be signed in to change notification settings - Fork 4
108 lines (94 loc) · 3.2 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
name: Test
on:
push:
branches:
- main
tags-ignore:
- "debian/*"
- "*-start"
pull_request:
branches:
- "*"
jobs:
test:
name: Test ${{ matrix.qgis }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
qgis:
- latest
- release-3_20
- release-3_18
- release-3_16
env:
LDI_LINZ_KEY: ${{ secrets.LDI_LINZ_KEY }}
LDI_MFE_KEY: ${{ secrets.LDI_MFE_KEY }}
LDI_NZDF_KEY: ${{ secrets.LDI_NZDF_KEY }}
LDI_BASEMAPS_KEY: ${{ secrets.LDI_BASEMAPS_KEY }}
steps:
- name: Check out repository
uses: actions/checkout@v2.4.0
with:
fetch-depth: 0
- name: Run test script
run: ./test.bash "${{ matrix.qgis }}" "$LDI_LINZ_KEY" "$LDI_MFE_KEY" "$LDI_NZDF_KEY" "$LDI_BASEMAPS_KEY"
lint:
name: Lint
runs-on: ubuntu-20.04
steps:
- name: Check out repository
uses: actions/checkout@v2.4.0
- uses: actions/setup-python@v2.2.2
with:
python-version: 3.8
- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --requirement=requirements-dev.txt
- name: Run pre-commit hooks
run: pre-commit run --all-files
deploy:
name: Deploy
if: startswith(github.ref, 'refs/tags/v')
needs: [test]
runs-on: ubuntu-20.04
steps:
- name: Check out repository
uses: actions/checkout@v2.4.0
with:
ref: ${{ github.ref }}
- name: Build project # This would actually build your project, using zip for an example artifact
run: |
echo ${{ github.repository }}
zip -r linz-data-importer.zip linz-data-importer
- name: Create Release
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: |
${{ github.ref }}]
draft: true
prerelease: true
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./linz-data-importer.zip
asset_name: linz-data-importer.zip
asset_content_type: application/zip
- name: Upload To LINZ DEV QGIS Plugin Repository in AWS
if: endswith(github.ref, 'UAT')
run: |
curl -X POST -H 'Content-Type: application/octet-stream' -H "authorization: bearer ${{ secrets.DEV_PLUGIN_REPO_AUTH }}" --data-binary @linz-data-importer.zip https://plugins.qgis.linz.govt.nz/v1/plugin/linz-data-importer?stage=dev
- name: Upload To LINZ PRD QGIS Plugin Repository in AWS
if: false == endswith(github.ref, 'UAT')
run: |
curl -X POST -H 'Content-Type: application/octet-stream' -H "authorization: bearer ${{ secrets.PRD_PLUGIN_REPO_AUTH }}" --data-binary @linz-data-importer.zip https://plugins.qgis.linz.govt.nz/v1/plugin/linz-data-importer