-
Notifications
You must be signed in to change notification settings - Fork 12
83 lines (70 loc) · 2.4 KB
/
pr_package.yml
File metadata and controls
83 lines (70 loc) · 2.4 KB
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
name: Creating plugin package in the PR
on:
pull_request:
types:
- edited
- opened
- reopened
- synchronize
branches:
- main
jobs:
create-package:
runs-on: ubuntu-22.04
container:
image: qgis/qgis:release-3_34
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Fix Python command
run: apt-get install python-is-python3
- name: Install python
uses: actions/setup-python@v4
- name: Install plugin dependencies
run: pip install -r requirements-dev.txt
- name: Get unique identifier
id: get-identifier
run: |
echo "::set-output name=PACKAGE_ID::$(python -c "import uuid; print(str(uuid.uuid4())[:4])")"
- name: Generate zip file
run: |
python admin.py build --output-directory ${{ format(
'docs/plugin/package/cplus_plugin_{0}_{1}/cplus_plugin/',
github.event.pull_request.head.ref,
steps.get-identifier.outputs.PACKAGE_ID) }}
- name: Plugin path details
id: get-zip-details
run: |
echo "::set-output name=ZIP_PATH::docs/plugin/package/$(ls docs/plugin/package)\n"
echo "::set-output name=ZIP_NAME::$(ls docs/plugin/package)"
- name: Uploading plugin build
id: artifact-upload-step
uses: actions/upload-artifact@v4
with:
name: ${{ steps.get-zip-details.outputs.ZIP_NAME }}
path: ${{ steps.get-zip-details.outputs.ZIP_PATH }}
- name: Save the PR number and plugin folder name into artifacts
shell: bash
env:
PR_NUMBER: ${{ github.event.number }}
ZIP_FILE_NAME: ${{ steps.get-zip-details.outputs.ZIP_NAME }}
ARTIFACT_URL: ${{ steps.artifact-upload-step.outputs.artifact-url }}
run: |
echo $PR_NUMBER > pr_number.txt
echo $ZIP_FILE_NAME > zip_file_name.txt
echo $ARTIFACT_URL > artifact_url.txt
- name: Upload the artifact url
uses: actions/upload-artifact@v4
with:
name: artifact_url
path: ./artifact_url.txt
- name: Upload the PR number
uses: actions/upload-artifact@v4
with:
name: pr_number
path: ./pr_number.txt
- name: Upload the zip file name
uses: actions/upload-artifact@v4
with:
name: zip_file_name
path: ./zip_file_name.txt