forked from Flipper-XFW/Xtreme-Firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (62 loc) · 2.14 KB
/
hotfix.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
name: "Hotfix"
on:
pull_request_review:
types: [submitted]
env:
TARGETS: f7
DEFAULT_TARGET: f7
jobs:
hotfix:
if: |
github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name &&
endsWith(github.event.pull_request.title, ' Hotfix') &&
github.event.review.author_association == 'OWNER' &&
startsWith(github.event.pull_request.title, 'V') &&
github.event.pull_request.base.ref == 'main' &&
github.event.pull_request.head.ref == 'dev' &&
github.event.pull_request.state == 'open' &&
github.event.pull_request.draft == false &&
github.event.review.state == 'APPROVED'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: 'Checkout code'
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: "Read version tag"
run: bash .github/workflow_data/version.sh
- name: 'Build the firmware'
run: |
set -e
for TARGET in ${TARGETS}; do
TARGET_HW="$(echo "${TARGET}" | sed 's/f//')"; \
./fbt TARGET_HW=$TARGET_HW DIST_SUFFIX=$VERSION_TAG FORCE_NO_DIRTY=1 updater_package
done
- name: "Check for uncommitted changes"
run: |
git diff --exit-code
- name: "Make tgz, zip and sdk"
run: bash .github/workflow_data/package.sh
- name: "Upload hotfix"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: |
python -m pip install requests
python .github/workflow_data/hotfix.py
- name: "Upload to webupdater"
env:
NC_HOST: "https://cloud.cynthialabs.net/"
NC_USERAGENT: "${{ secrets.NC_USERAGENT }}"
NC_USER: "${{ secrets.NC_USER }}"
NC_PASS: "${{ secrets.NC_PASS }}"
run: |
python -m pip install pyncclient
python .github/workflow_data/webupdater.py
- name: "Merge pull request"
uses: "pascalgn/[email protected]"
env:
MERGE_LABELS: ""
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"