Skip to content

Commit 687c1a7

Browse files
authored
Merge pull request #6 from derskythe/feat/version-2
Feat/version 2
2 parents 1eaa151 + 81b1378 commit 687c1a7

18 files changed

+942
-263
lines changed

.github/changelog-conf.json

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
{
2+
"categories": [
3+
{
4+
"title": "## 🚀 Features",
5+
"labels": [
6+
"feature",
7+
"feat",
8+
"enhancement"
9+
]
10+
},
11+
{
12+
"title": "## 🐛 Fixes",
13+
"labels": [
14+
"fix", "bug", "invalid", "dublicate"
15+
]
16+
},
17+
{
18+
"key": "tests",
19+
"title": "## 🧪 Tests",
20+
"labels": [
21+
"test"
22+
]
23+
},
24+
{
25+
"title": "## 💬 Other",
26+
"labels": [
27+
"dublicate",
28+
"wontfix",
29+
"ci/di"
30+
]
31+
},
32+
{
33+
"title": "## 📚 Documentation",
34+
"labels": [
35+
"doc", "documentation"
36+
]
37+
},
38+
{
39+
"title": "## 📦 Dependencies",
40+
"labels": [
41+
"dependencies",
42+
"sync"
43+
]
44+
},
45+
{
46+
"title": "## 🧪 Tests and some 🪄 Magic",
47+
"labels": [
48+
"test",
49+
"magic"
50+
],
51+
"exclude_labels": [
52+
"no-magic"
53+
],
54+
"exhaustive": true,
55+
"exhaustive_rules": "false",
56+
"empty_content": "- no matching PRs",
57+
"rules": [
58+
{
59+
"pattern": "open",
60+
"on_property": "status",
61+
"flags": "gu"
62+
}
63+
]
64+
}
65+
],
66+
"ignore_labels": [
67+
"ignore"
68+
],
69+
"sort": {
70+
"order": "ASC",
71+
"on_property": "mergedAt"
72+
},
73+
"template": "#{{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n#{{UNCATEGORIZED}}\n</details>",
74+
"pr_template": "${{TITLE}}\n${{NUMBER}}\n${{URL}}\n${{MERGED_AT}}\n${{AUTHOR}}\n${{LABELS}}\n${{MILESTONE}}\n${{BODY}}\n${{ASSIGNEES}}\n${{REVIEWERS}}",
75+
"empty_template": "- no changes",
76+
"label_extractor": [
77+
{
78+
"pattern": "(.) (.+)",
79+
"target": "$1",
80+
"flags": "gu"
81+
},
82+
{
83+
"pattern": "\\[Issue\\]",
84+
"on_property": "title",
85+
"method": "match"
86+
}
87+
],
88+
"duplicate_filter": {
89+
"pattern": "\\[ABC-....\\]",
90+
"on_property": "title",
91+
"method": "match"
92+
},
93+
"reference": {
94+
"pattern": ".*\\ \\#(.).*",
95+
"on_property": "body",
96+
"method": "replace",
97+
"target": "$1"
98+
},
99+
"transformers": [
100+
{
101+
"pattern": "[\\-\\*] (\\[(...|TEST|CI|SKIP)\\])( )?(.+?)\n(.+?[\\-\\*] )(.+)",
102+
"target": "- $4\n - $6"
103+
}
104+
],
105+
"trim_values": false,
106+
"max_tags_to_fetch": 200,
107+
"max_pull_requests": 200,
108+
"max_back_track_time_days": 365,
109+
"tag_resolver": {
110+
"method": "semver",
111+
"filter": {
112+
"pattern": "api-(.+)",
113+
"flags": "gu"
114+
}
115+
},
116+
"base_branches": [
117+
"master"
118+
]
119+
}

.github/workflows/changelog.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: 'CI'
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
7+
jobs:
8+
release:
9+
if: startsWith(github.ref, 'refs/tags/')
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Build Changelog
13+
id: github_release
14+
uses: mikepenz/release-changelog-builder-action@v3
15+
with:
16+
configuration: "changelog-conf.json"
17+
ignorePreReleases: true
18+
fetchReviewers: true
19+
fetchReviews: true
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- name: Create Release
24+
uses: mikepenz/action-gh-release@v0.2.0-a03 #softprops/action-gh-release
25+
with:
26+
body: ${{steps.github_release.outputs.changelog}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
name: "Force build for Firmware"
2+
run-name: "Build ${{ inputs.DEPLOY_TARGET }} by @${{ github.ACTOR }}"
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
version:
8+
description: "Enter version to build or left empty for current version"
9+
required: false
10+
type: string
11+
12+
permissions:
13+
contents: write
14+
packages: write
15+
16+
concurrency:
17+
group: force-firmware-build-${{ vars.FIRMWARE_VERSION }}-${{ vars.RELEASE_VERSION }}
18+
cancel-in-progress: false
19+
20+
jobs:
21+
build-and-upload:
22+
runs-on: ["ubuntu-latest"]
23+
env:
24+
FAP_INCLUDED_IN_FW: 0
25+
REPO_SELF: ${{ vars.REPO_SELF }}
26+
OFW_PATH: "applications_user/${{ vars.FAP_NAME }}"
27+
RELATIVE_PATH: "applications/external/${{ vars.FAP_NAME }}"
28+
CURRENT_VERSION: ${{ vars.RELEASE_VERSION }}
29+
RELEASE_VERSION: ${{ inputs.VERSION }}
30+
ZIP_NAME: ""
31+
ZIP_TAG: ""
32+
TGZ_NAME: ""
33+
TGZ_TAG: ""
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
firmware: [unlshd, official]
38+
include:
39+
- firmware: unlshd
40+
url: ${{ vars.REPO_UNLEASHED }}
41+
version: ${{ vars.FIRMWARE_VERSION }}
42+
src-included: 0
43+
- firmware: official
44+
url: ${{ vars.REPO_OFFICIAL }}
45+
version: "official"
46+
src-included: 0
47+
steps:
48+
- name: Set version
49+
env:
50+
INPUT_VERSION: ${{ inputs.version }}
51+
CURRENT_VERSION: ${{ env.CURRENT_VERSION }}
52+
shell: pwsh
53+
run: |
54+
$ReleaseVersion = ([string]::IsNullOrWhitespace($env:INPUT_VERSION) ? $env:CURRENT_VERSION : $env:INPUT_VERSION)
55+
Write-Output ('RELEASE_VERSION={0}' -f $ReleaseVersion) >> $env:GITHUB_ENV
56+
57+
- name: Copy Firmware Files
58+
uses: actions/checkout@v3
59+
with:
60+
repository: "${{ matrix.url }}"
61+
clean: "true"
62+
submodules: "true"
63+
ref: "dev"
64+
65+
- name: Copy Repo Files
66+
if: ${{ matrix.src-included == 0 }}
67+
uses: actions/checkout@v3
68+
with:
69+
repository: "${{ vars.REPO_SELF }}"
70+
clean: "true"
71+
submodules: "true"
72+
path: "${{ env.OFW_PATH }}"
73+
74+
- name: Print vars about state or repo if Unleashed
75+
if: ${{ matrix.src-included == 1 }}
76+
shell: pwsh
77+
run: |
78+
git log --pretty=format:'%s by %C(yellow)%an%Creset (%ad)%n %n%b' --date=local --abbrev-commit --max-count=1
79+
if( ${{ env.FAP_INCLUDED_IN_FW }} -eq 1 ) {
80+
git submodule set-branch --branch master '${{ env.RELATIVE_PATH }}'
81+
git submodule sync '${{ env.RELATIVE_PATH }}'
82+
}
83+
cd '${{ env.OFW_PATH }}'
84+
$Output = (git log --pretty=format:'%s by %C(yellow)%an%Creset (%ad)%n %n%b' --date=local --abbrev-commit --max-count=1)
85+
86+
if ( $LASTEXITCODE -ne 0 ) {
87+
Write-Error '::error title=Invalid checkout::Invalid checkout'
88+
exit 1
89+
}
90+
Write-Output ('::notice title=Git output::{0}' -f $Output)
91+
92+
- name: Print vars about state or repo if Official
93+
if: ${{ matrix.src-included == 0 }}
94+
shell: pwsh
95+
run: |
96+
git log --pretty=format:'%s by %C(yellow)%an%Creset (%ad)%n %n%b' --date=local --abbrev-commit --max-count=1
97+
cd '${{ env.OFW_PATH }}'
98+
99+
if ( '${{ env.CURRENT_VERSION }}' -ne '${{ env.RELEASE_VERSION }}' ) {
100+
Write-Output '::warning title=Different version::Current version is ${{ env.CURRENT_VERSION }} but we trying to build ${{ env.RELEASE_VERSION }}'
101+
} else {
102+
$Output = (git log --pretty=format:'%s by %C(yellow)%an%Creset (%ad)%n %n%b' --date=local --abbrev-commit --max-count=1)
103+
Write-Output ('::notice title=Git output::{0}' -f $Output)
104+
}
105+
106+
- name: Remove other apps
107+
shell: pwsh
108+
if: ${{ success() }}
109+
# rm to remove problem FAP which includes non-existent files
110+
run: |
111+
Remove-Item -Force -Recurse ./applications/debug -ErrorAction SilentlyContinue
112+
Remove-Item -Force -Recurse ./applications/examples -ErrorAction SilentlyContinue
113+
114+
- name: Build Firmware
115+
shell: bash
116+
if: ${{ success() }}
117+
env:
118+
FBT_NO_SYNC: 0
119+
DIST_SUFFIX: ${{ matrix.version }}
120+
WORKFLOW_BRANCH_OR_TAG: release-cfw
121+
run: |
122+
./fbt COMPACT=1 DEBUG=0 FBT_NO_SYNC=0
123+
124+
- name: Build FAPs
125+
shell: bash
126+
if: ${{ success() }}
127+
env:
128+
FBT_NO_SYNC: 0
129+
DIST_SUFFIX: ${{ matrix.version }}
130+
WORKFLOW_BRANCH_OR_TAG: release-cfw
131+
# rm to remove problem FAP which includes non-existent files
132+
run: |
133+
./fbt COMPACT=1 DEBUG=0 FBT_NO_SYNC=0 fap_dist
134+
135+
- name: Create assets
136+
if: ${{ success() }}
137+
shell: pwsh
138+
env:
139+
ZIP_NAME: "${{ vars.FAP_NAME }}_${{ env.RELEASE_VERSION }}_${{ matrix.firmware }}.zip"
140+
TGZ_NAME: "${{ vars.FAP_NAME }}_${{ env.RELEASE_VERSION }}_${{ matrix.firmware }}.tgz"
141+
run: |
142+
function Format-Bytes {
143+
param(
144+
[int]$number
145+
)
146+
$sizes = 'KB', 'MB', 'GB', 'TB', 'PB'
147+
for ($x = 0; $x -lt $sizes.count; $x++) {
148+
if ($number -lt [int64]"1$($sizes[$x])") {
149+
if ($x -eq 0) {
150+
return "$number B"
151+
}
152+
else {
153+
$num = $number / [int64]"1$($sizes[$x-1])"
154+
$num = "{0:N2}" -f $num
155+
return "$num $($sizes[$x-1])"
156+
}
157+
}
158+
}
159+
}
160+
$ZipName = $env:ZIP_NAME
161+
$TgzName = $env:TGZ_NAME
162+
$FapNamme = '${{ vars.FAP_NAME }}.fap'
163+
$DstFap = "./$FapNamme"
164+
$AppDir = "dist/f7-C/apps/Sub-GHz"
165+
166+
if (!(Test-Path -Path "$AppDir/$FapNamme" -PathType Leaf)) {
167+
Write-Error '::error title=Files not found::Cannot find files in location'
168+
exit 1
169+
}
170+
171+
$Size = (Get-Item -Path "$AppDir/$FapNamme" | Get-ItemPropertyValue -Name Length)
172+
Write-Output ('Filesize: {0}' -f (Format-Bytes $Size))
173+
Copy-Item -Force -Verbose -Path "$AppDir/$FapNamme" -Destination $DstFap
174+
175+
zip -r -qq $ZipName $DstFap
176+
tar zcf $TgzName $DstFap
177+
178+
if ( !(Test-Path -Path $ZipName -PathType Leaf) -or !(Test-Path -Path $TgzName -PathType Leaf) ) {
179+
Write-Error '::error title=Files not found::Cannot find files in location'
180+
exit 1
181+
}
182+
183+
$ZipSize = Format-Bytes (Get-Item -Path $ZipName).Length
184+
$TgzSize = Format-Bytes (Get-Item -Path $TgzName ).Length
185+
186+
Write-Output ('ZIP_NAME={0}' -f $ZipName) >> $env:GITHUB_ENV
187+
Write-Output ('TGZ_NAME={0}' -f $TgzName ) >> $env:GITHUB_ENV
188+
Write-Output ('ZIP_TAG={0} ({1})' -f $ZipName, $ZipSize) >> $env:GITHUB_ENV
189+
Write-Output ('TGZ_TAG={0} ({1})' -f $TgzName , $TgzSize) >> $env:GITHUB_ENV
190+
191+
- name: Upload assets
192+
if: ${{ success() && env.ZIP_NAME != '' }}
193+
env:
194+
GITHUB_TOKEN: ${{ secrets.FLIPPER_TOKEN }}
195+
run: |
196+
gh release create v${{ env.RELEASE_VERSION }} --generate-notes --draft -R ${{ env.REPO_SELF }}
197+
gh release upload 'v${{ env.RELEASE_VERSION }}' '${{ env.ZIP_NAME }}#${{ env.ZIP_TAG }}' \
198+
'${{ env.TGZ_NAME }}#${{ env.TGZ_TAG }}' --clobber -R ${{ env.REPO_SELF }}
199+
gh release edit 'v${{ env.RELEASE_VERSION }}' --draft=false -R ${{ env.REPO_SELF }}
200+
201+
#EOF

README.md

+30-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,34 @@
11
# ShapShup App for Flipper Zero
2-
---
3-
42
[![Version check for NEW release](https://github.com/derskythe/flipperzero-shapshup/actions/workflows/version-check.yml/badge.svg)](https://github.com/derskythe/flipperzero-shapshup/actions/workflows/version-check.yml)
53
[![Build for Firmware](https://github.com/derskythe/flipperzero-shapshup/actions/workflows/build-with-firmwware.yml/badge.svg)](https://github.com/derskythe/flipperzero-shapshup/actions/workflows/build-with-firmwware.yml)
64

7-
<apan style="color: gray">Under construction</span>
5+
6+
![02](https://github.com/derskythe/flipperzero-shapshup/assets/31771569/51ceca37-b322-4926-8b9e-413f616e1922)
7+
8+
---
9+
## Description
10+
11+
A simple application for viewing SubGhz RAW files in the form of a signal level as it is shows in SubGHz RAW read mode.
12+
13+
## Instruction
14+
15+
First you need to select RAW file.<br/>
16+
![01](https://github.com/derskythe/flipperzero-shapshup/assets/31771569/fcd95d16-ff6e-42f9-ae91-890bb1d4e4ee)
17+
18+
Then you can view signal levels of selected file.
19+
You can zoom-in :arrow_down_small: or zoom-out :arrow_up_small: levels
20+
21+
![03](https://github.com/derskythe/flipperzero-shapshup/assets/31771569/d1090ba6-1bf4-46e8-93aa-fbf86512f3cc)
22+
23+
Also you can walk through the file with forward and backward buttons
24+
25+
#### Buttons
26+
27+
| Button | Action |
28+
|:---------------------------:|:---------------------:|
29+
| :arrow_backward: | Go backward |
30+
| :arrow_up_small: | Zoom-out |
31+
| :arrow_forward: | Go forward |
32+
| :arrow_down_small: | Zoom-in |
33+
| :record_button: | Select another file |
34+
| :leftwards_arrow_with_hook: | Long press to EXIT |

0 commit comments

Comments
 (0)