-
Notifications
You must be signed in to change notification settings - Fork 15
51 lines (42 loc) · 1.4 KB
/
build.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
name: Build
on:
push:
pull_request:
jobs:
build:
name: "Build"
runs-on: ubuntu-latest
steps:
- name: Get source code
uses: actions/checkout@v4
with:
# To fetch tags
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "requirements/packaging.txt"
- name: Install Python requirements
run: pip install -r requirements/packaging.txt
- name: Set plugin version environment variables
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
echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Build package
run: |
qgis-plugin-ci --no-validation package ${{ env.VERSION }}
mkdir tmp
unzip firstaid.${{ env.VERSION }}.zip -d tmp
- name: Save PR number to zips
run: |
cd tmp
echo ${{ github.event.number }} | tee pr_number
echo ${{ github.event.pull_request.head.sha }} | tee git_commit
echo ${{ github.event.number }}
- uses: actions/upload-artifact@v2
with:
name: firstaid
path: tmp