Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 8c91fd8

Browse files
V50 Release (#340)
2 parents a95edbc + c20d234 commit 8c91fd8

1,463 files changed

Lines changed: 34801 additions & 13565 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflow_data/commit.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
export VERSION_TAG="$(python -c 'import fbt_options; print(fbt_options.DIST_SUFFIX, end="")')"
4+
echo "VERSION_TAG=${VERSION_TAG}" >> $GITHUB_ENV

.github/workflow_data/devbuild.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/usr/bin/env python
2+
import nextcloud_client
3+
import datetime as dt
4+
import requests
5+
import json
6+
import os
7+
8+
dev_share = os.environ["NC_HOST"] + "s/sGHsQB94a9x5CRs/download?path=/&files={files}"
9+
10+
if __name__ == "__main__":
11+
with open(os.environ["GITHUB_EVENT_PATH"], "r") as f:
12+
event = json.load(f)
13+
14+
client = nextcloud_client.Client(os.environ["NC_HOST"])
15+
client.login(os.environ["NC_USER"], os.environ["NC_PASS"])
16+
17+
for file in (
18+
os.environ["ARTIFACT_TGZ"],
19+
os.environ["ARTIFACT_SDK"],
20+
):
21+
path = f"XFW-Dev/{file}"
22+
# try:
23+
# client.delete(path)
24+
# except Exception:
25+
# pass
26+
client.put_file(path, file)
27+
28+
requests.post(
29+
os.environ["BUILD_WEBHOOK"],
30+
headers={"Accept": "application/json", "Content-Type": "application/json"},
31+
json={
32+
"content": None,
33+
"embeds": [
34+
{
35+
"title": "Devbuild infos:",
36+
"description": "",
37+
"url": "",
38+
"color": 16734443,
39+
"fields": [
40+
{
41+
"name": "Changes since last commit:",
42+
"value": f"[Compare {event['before'][:7]} to {event['after'][:7]}]({event['compare']})"
43+
},
44+
{
45+
"name": "Changes since last release:",
46+
"value": f"[Compare release to {event['after'][:7]}]({event['compare'].rsplit('/', 1)[0] + '/main...' + event['after']})"
47+
},
48+
{
49+
"name": "Firmware download:",
50+
"value": f"- [Download SDK for development]({dev_share.format(files=os.environ['ARTIFACT_SDK'])})\n- [Download Firmware TGZ]({dev_share.format(files=os.environ['ARTIFACT_TGZ'])})"
51+
}
52+
],
53+
"author": {
54+
"name": "Build Succeeded!",
55+
"icon_url": "https://cdn.discordapp.com/emojis/1080005692485795930.png"
56+
},
57+
"footer": {
58+
"text": "Build go brrrr",
59+
"icon_url": "https://cdn.discordapp.com/emojis/1059798228725403719.png"
60+
},
61+
"timestamp": dt.datetime.utcnow().isoformat()
62+
}
63+
],
64+
},
65+
)

.github/workflow_data/hotfix.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121

2222
artifacts = {
2323
os.environ['ARTIFACT_TGZ']: "application/gzip",
24-
os.environ['ARTIFACT_ZIP']: "application/zip"
24+
os.environ['ARTIFACT_ZIP']: "application/zip",
25+
os.environ['ARTIFACT_SDK']: "application/zip",
2526
}
2627

2728
for asset in release["assets"]:
@@ -59,7 +60,7 @@
5960

6061
body = release["body"]
6162
body = re.sub(
62-
r"(https://github\.com/ClaraCrazy/Flipper-Xtreme/releases/download/[A-Za-z0-9_-]+?/)[A-Za-z0-9_-]+",
63+
r"(https://github\.com/Flipper-XFW/Xtreme-Firmware/releases/download/[A-Za-z0-9_-]+?/)[A-Za-z0-9_-]+",
6364
r"\1" + os.environ['VERSION_TAG'],
6465
body
6566
)

.github/workflow_data/package.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@ export ARTIFACT_DIR="${VERSION_TAG}"
33

44
export ARTIFACT_TGZ="${VERSION_TAG}.tgz"
55
export ARTIFACT_ZIP="${VERSION_TAG}.zip"
6+
export ARTIFACT_SDK="${VERSION_TAG}-sdk.zip"
67
cd dist/${DEFAULT_TARGET}-*
78
mv ${DEFAULT_TARGET}-update-* ${ARTIFACT_DIR}
89
tar --format=ustar -czvf ../../${ARTIFACT_TGZ} ${ARTIFACT_DIR}
910
cd ${ARTIFACT_DIR}
1011
7z a ../../../${ARTIFACT_ZIP} .
11-
cd ../../..
12+
cd ..
13+
mv flipper-z-${DEFAULT_TARGET}-sdk-*.zip ../../${ARTIFACT_SDK}
14+
cd ../..
1215

1316
echo "ARTIFACT_TGZ=${ARTIFACT_TGZ}" >> $GITHUB_ENV
1417
echo "ARTIFACT_ZIP=${ARTIFACT_ZIP}" >> $GITHUB_ENV
18+
echo "ARTIFACT_SDK=${ARTIFACT_SDK}" >> $GITHUB_ENV

.github/workflow_data/release.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
## ⬇️ Download
22
>### [🖥️ Web Updater (chrome)](https://flipper-xtre.me/update) [recommended]
33
4-
>### [🐬 qFlipper Package (.tgz)](https://github.com/ClaraCrazy/Flipper-Xtreme/releases/download/{VERSION_TAG}/{ARTIFACT_TGZ})
4+
>### [🐬 qFlipper Package (.tgz)](https://github.com/Flipper-XFW/Xtreme-Firmware/releases/download/{VERSION_TAG}/{ARTIFACT_TGZ})
55
6-
>### [📦 Zipped Archive (.zip)](https://github.com/ClaraCrazy/Flipper-Xtreme/releases/download/{VERSION_TAG}/{ARTIFACT_ZIP})
6+
>### [📦 Zipped Archive (.zip)](https://github.com/Flipper-XFW/Xtreme-Firmware/releases/download/{VERSION_TAG}/{ARTIFACT_ZIP})
77
8-
**Check the [install guide](https://github.com/ClaraCrazy/Flipper-Xtreme#install) if you're not sure, or [join our Discord](https://discord.gg/flipper-xtreme) if you have questions or encounter issues!**
8+
**Check the [install guide](https://github.com/Flipper-XFW/Xtreme-Firmware#install) if you're not sure, or [join our Discord](https://discord.gg/flipper-xtreme) if you have questions or encounter issues!**
99

1010
## ❤️ Support
1111
If you like what you're seeing, **please consider donating to us**. We won't ever put this behind a paywall, but we'd still appreciate a few bucks!

.github/workflow_data/version.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
#!/bin/bash
22

3-
export VERSION_TAG="$(python -c 'import fbt_options; print(fbt_options.DIST_SUFFIX)')"
3+
export VERSION_TAG="$(python -c '''
4+
import datetime as dt
5+
import json
6+
import os
7+
with open(os.environ["GITHUB_EVENT_PATH"], "r") as f:
8+
event = json.load(f)
9+
version = int(event["pull_request"]["title"].removeprefix("V").removesuffix(" Release").removesuffix(" Hotfix"))
10+
date = dt.datetime.now().strftime("%d%m%Y")
11+
print(f"XFW-{version:04}_{date}", end="")
12+
''')"
413
echo "VERSION_TAG=${VERSION_TAG}" >> $GITHUB_ENV

.github/workflow_data/webhook.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,16 @@
1616

1717
match os.environ["GITHUB_EVENT_NAME"]:
1818
case "push":
19+
webhook = "BUILD_WEBHOOK"
1920
count = len(event["commits"])
21+
if count == 20:
22+
count = int(requests.get(
23+
event["compare"].replace("github.com", "api.github.com/repos"),
24+
headers={
25+
"Accept": "application/vnd.github.v3+json",
26+
"Authorization": f"token {os.environ['GITHUB_TOKEN']}"
27+
}
28+
).json()["total_commits"])
2029
branch = event["ref"].removeprefix("refs/heads/")
2130
change = (
2231
"Force Push"

.github/workflows/build.yml

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
- '*'
1010
pull_request:
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
14+
cancel-in-progress: true
15+
1216
env:
1317
TARGETS: f7
1418
DEFAULT_TARGET: f7
@@ -24,47 +28,38 @@ jobs:
2428
fetch-depth: 0
2529
ref: ${{ github.event.pull_request.head.sha }}
2630

31+
- name: "Read version tag"
32+
run: bash .github/workflow_data/commit.sh
33+
2734
- name: 'Build the firmware'
2835
run: |
2936
set -e
3037
for TARGET in ${TARGETS}; do
3138
TARGET_HW="$(echo "${TARGET}" | sed 's/f//')"; \
32-
./fbt TARGET_HW=$TARGET_HW updater_package
39+
./fbt TARGET_HW=$TARGET_HW DIST_SUFFIX=$VERSION_TAG updater_package
3340
done
3441
3542
- name: "Check for uncommitted changes"
3643
run: |
3744
git diff --exit-code
3845
39-
- name: 'Updater artifact'
46+
- name: 'Dist artifact'
4047
uses: actions/upload-artifact@v3
4148
with:
42-
name: updater
49+
name: dist
4350
path: |
44-
dist/${{ env.DEFAULT_TARGET }}-*/${{ env.DEFAULT_TARGET }}-update-*/
51+
dist/${{ env.DEFAULT_TARGET }}-*/
4552
46-
# - name: 'Find Previous Comment'
47-
# if: ${{ github.event.pull_request }}
48-
# uses: peter-evans/find-comment@v1
49-
# id: fc
50-
# with:
51-
# issue-number: ${{ github.event.pull_request.number }}
52-
# comment-author: 'github-actions[bot]'
53-
# body-includes: 'Compiled firmware:'
53+
- name: "Make tgz, zip and sdk"
54+
run: bash .github/workflow_data/package.sh
5455

55-
# - name: Artifact info
56-
# id: artifact-info
57-
# uses: dawidd6/action-download-artifact@v2
58-
# with:
59-
# dry_run: true
60-
61-
# - name: 'Create or update comment'
62-
# if: ${{ github.event.pull_request}}
63-
# uses: peter-evans/create-or-update-comment@v1
64-
# with:
65-
# comment-id: ${{ steps.fc.outputs.comment-id }}
66-
# issue-number: ${{ github.event.pull_request.number }}
67-
# body: |
68-
# **Compiled firmware:**
69-
# - [📦 Update package](${{steps.artifact-info.outputs.artifacts[0].archive_download_url}})
70-
# edit-mode: replace
56+
- name: Send devbuild webhook
57+
if: "github.event_name == 'push' && github.ref_name == 'dev'"
58+
env:
59+
NC_HOST: "https://cloud.cynthialabs.net/"
60+
NC_USER: "${{ secrets.NC_USER }}"
61+
NC_PASS: "${{ secrets.NC_PASS }}"
62+
BUILD_WEBHOOK: ${{ secrets.BUILD_WEBHOOK }}
63+
run: |
64+
python -m pip install pyncclient
65+
python .github/workflow_data/devbuild.py

.github/workflows/hotfix.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,22 @@ jobs:
3131
fetch-depth: 0
3232
ref: ${{ github.event.pull_request.head.sha }}
3333

34+
- name: "Read version tag"
35+
run: bash .github/workflow_data/version.sh
36+
3437
- name: 'Build the firmware'
3538
run: |
3639
set -e
3740
for TARGET in ${TARGETS}; do
3841
TARGET_HW="$(echo "${TARGET}" | sed 's/f//')"; \
39-
./fbt TARGET_HW=$TARGET_HW FORCE_NO_DIRTY=1 updater_package
42+
./fbt TARGET_HW=$TARGET_HW DIST_SUFFIX=$VERSION_TAG FORCE_NO_DIRTY=1 updater_package
4043
done
4144
4245
- name: "Check for uncommitted changes"
4346
run: |
4447
git diff --exit-code
4548
46-
- name: "Read version tag"
47-
run: bash .github/workflow_data/version.sh
48-
49-
- name: "Make tgz and zip"
49+
- name: "Make tgz, zip and sdk"
5050
run: bash .github/workflow_data/package.sh
5151

5252
- name: "Upload hotfix"

.github/workflows/release.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
release:
1313
if: |
1414
github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name &&
15-
endsWith(github.event.pull_request.title, ' Release Candidate Changes') &&
16-
github.event.review.author_association == 'OWNER' &&
15+
endsWith(github.event.pull_request.title, ' Release') &&
16+
github.event.review.author_association == 'MEMBER' &&
1717
startsWith(github.event.pull_request.title, 'V') &&
1818
github.event.pull_request.base.ref == 'main' &&
1919
github.event.pull_request.head.ref == 'dev' &&
@@ -31,22 +31,22 @@ jobs:
3131
fetch-depth: 0
3232
ref: ${{ github.event.pull_request.head.sha }}
3333

34+
- name: "Read version tag"
35+
run: bash .github/workflow_data/version.sh
36+
3437
- name: 'Build the firmware'
3538
run: |
3639
set -e
3740
for TARGET in ${TARGETS}; do
3841
TARGET_HW="$(echo "${TARGET}" | sed 's/f//')"; \
39-
./fbt TARGET_HW=$TARGET_HW FORCE_NO_DIRTY=1 updater_package
42+
./fbt TARGET_HW=$TARGET_HW DIST_SUFFIX=$VERSION_TAG FORCE_NO_DIRTY=1 updater_package
4043
done
4144
4245
- name: "Check for uncommitted changes"
4346
run: |
4447
git diff --exit-code
4548
46-
- name: "Read version tag"
47-
run: bash .github/workflow_data/version.sh
48-
49-
- name: "Make tgz and zip"
49+
- name: "Make tgz, zip and sdk"
5050
run: bash .github/workflow_data/package.sh
5151

5252
- name: "Update release notes"
@@ -76,6 +76,7 @@ jobs:
7676
files: |
7777
${{ env.ARTIFACT_TGZ }}
7878
${{ env.ARTIFACT_ZIP }}
79+
${{ env.ARTIFACT_SDK }}
7980
name: "${{ env.VERSION_TAG }}"
8081
tag_name: "${{ env.VERSION_TAG }}"
8182
target_commitish: ${{ github.event.pull_request.base.ref }}

0 commit comments

Comments
 (0)