Skip to content

Commit

Permalink
Merge pull request #6 from derskythe/feat/version-2
Browse files Browse the repository at this point in the history
Feat/version 2
  • Loading branch information
derskythe authored Sep 16, 2023
2 parents 1eaa151 + 81b1378 commit 687c1a7
Show file tree
Hide file tree
Showing 18 changed files with 942 additions and 263 deletions.
119 changes: 119 additions & 0 deletions .github/changelog-conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"categories": [
{
"title": "## 🚀 Features",
"labels": [
"feature",
"feat",
"enhancement"
]
},
{
"title": "## 🐛 Fixes",
"labels": [
"fix", "bug", "invalid", "dublicate"
]
},
{
"key": "tests",
"title": "## 🧪 Tests",
"labels": [
"test"
]
},
{
"title": "## 💬 Other",
"labels": [
"dublicate",
"wontfix",
"ci/di"
]
},
{
"title": "## 📚 Documentation",
"labels": [
"doc", "documentation"
]
},
{
"title": "## 📦 Dependencies",
"labels": [
"dependencies",
"sync"
]
},
{
"title": "## 🧪 Tests and some 🪄 Magic",
"labels": [
"test",
"magic"
],
"exclude_labels": [
"no-magic"
],
"exhaustive": true,
"exhaustive_rules": "false",
"empty_content": "- no matching PRs",
"rules": [
{
"pattern": "open",
"on_property": "status",
"flags": "gu"
}
]
}
],
"ignore_labels": [
"ignore"
],
"sort": {
"order": "ASC",
"on_property": "mergedAt"
},
"template": "#{{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n#{{UNCATEGORIZED}}\n</details>",
"pr_template": "${{TITLE}}\n${{NUMBER}}\n${{URL}}\n${{MERGED_AT}}\n${{AUTHOR}}\n${{LABELS}}\n${{MILESTONE}}\n${{BODY}}\n${{ASSIGNEES}}\n${{REVIEWERS}}",
"empty_template": "- no changes",
"label_extractor": [
{
"pattern": "(.) (.+)",
"target": "$1",
"flags": "gu"
},
{
"pattern": "\\[Issue\\]",
"on_property": "title",
"method": "match"
}
],
"duplicate_filter": {
"pattern": "\\[ABC-....\\]",
"on_property": "title",
"method": "match"
},
"reference": {
"pattern": ".*\\ \\#(.).*",
"on_property": "body",
"method": "replace",
"target": "$1"
},
"transformers": [
{
"pattern": "[\\-\\*] (\\[(...|TEST|CI|SKIP)\\])( )?(.+?)\n(.+?[\\-\\*] )(.+)",
"target": "- $4\n - $6"
}
],
"trim_values": false,
"max_tags_to_fetch": 200,
"max_pull_requests": 200,
"max_back_track_time_days": 365,
"tag_resolver": {
"method": "semver",
"filter": {
"pattern": "api-(.+)",
"flags": "gu"
}
},
"base_branches": [
"master"
]
}
26 changes: 26 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 'CI'
on:
push:
tags:
- '*'

jobs:
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v3
with:
configuration: "changelog-conf.json"
ignorePreReleases: true
fetchReviewers: true
fetchReviews: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
uses: mikepenz/[email protected] #softprops/action-gh-release
with:
body: ${{steps.github_release.outputs.changelog}}
201 changes: 201 additions & 0 deletions .github/workflows/force-build-with-firmwware.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
name: "Force build for Firmware"
run-name: "Build ${{ inputs.DEPLOY_TARGET }} by @${{ github.ACTOR }}"

on:
workflow_dispatch:
inputs:
version:
description: "Enter version to build or left empty for current version"
required: false
type: string

permissions:
contents: write
packages: write

concurrency:
group: force-firmware-build-${{ vars.FIRMWARE_VERSION }}-${{ vars.RELEASE_VERSION }}
cancel-in-progress: false

jobs:
build-and-upload:
runs-on: ["ubuntu-latest"]
env:
FAP_INCLUDED_IN_FW: 0
REPO_SELF: ${{ vars.REPO_SELF }}
OFW_PATH: "applications_user/${{ vars.FAP_NAME }}"
RELATIVE_PATH: "applications/external/${{ vars.FAP_NAME }}"
CURRENT_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: ${{ inputs.VERSION }}
ZIP_NAME: ""
ZIP_TAG: ""
TGZ_NAME: ""
TGZ_TAG: ""
strategy:
fail-fast: false
matrix:
firmware: [unlshd, official]
include:
- firmware: unlshd
url: ${{ vars.REPO_UNLEASHED }}
version: ${{ vars.FIRMWARE_VERSION }}
src-included: 0
- firmware: official
url: ${{ vars.REPO_OFFICIAL }}
version: "official"
src-included: 0
steps:
- name: Set version
env:
INPUT_VERSION: ${{ inputs.version }}
CURRENT_VERSION: ${{ env.CURRENT_VERSION }}
shell: pwsh
run: |
$ReleaseVersion = ([string]::IsNullOrWhitespace($env:INPUT_VERSION) ? $env:CURRENT_VERSION : $env:INPUT_VERSION)
Write-Output ('RELEASE_VERSION={0}' -f $ReleaseVersion) >> $env:GITHUB_ENV
- name: Copy Firmware Files
uses: actions/checkout@v3
with:
repository: "${{ matrix.url }}"
clean: "true"
submodules: "true"
ref: "dev"

- name: Copy Repo Files
if: ${{ matrix.src-included == 0 }}
uses: actions/checkout@v3
with:
repository: "${{ vars.REPO_SELF }}"
clean: "true"
submodules: "true"
path: "${{ env.OFW_PATH }}"

- name: Print vars about state or repo if Unleashed
if: ${{ matrix.src-included == 1 }}
shell: pwsh
run: |
git log --pretty=format:'%s by %C(yellow)%an%Creset (%ad)%n %n%b' --date=local --abbrev-commit --max-count=1
if( ${{ env.FAP_INCLUDED_IN_FW }} -eq 1 ) {
git submodule set-branch --branch master '${{ env.RELATIVE_PATH }}'
git submodule sync '${{ env.RELATIVE_PATH }}'
}
cd '${{ env.OFW_PATH }}'
$Output = (git log --pretty=format:'%s by %C(yellow)%an%Creset (%ad)%n %n%b' --date=local --abbrev-commit --max-count=1)
if ( $LASTEXITCODE -ne 0 ) {
Write-Error '::error title=Invalid checkout::Invalid checkout'
exit 1
}
Write-Output ('::notice title=Git output::{0}' -f $Output)
- name: Print vars about state or repo if Official
if: ${{ matrix.src-included == 0 }}
shell: pwsh
run: |
git log --pretty=format:'%s by %C(yellow)%an%Creset (%ad)%n %n%b' --date=local --abbrev-commit --max-count=1
cd '${{ env.OFW_PATH }}'
if ( '${{ env.CURRENT_VERSION }}' -ne '${{ env.RELEASE_VERSION }}' ) {
Write-Output '::warning title=Different version::Current version is ${{ env.CURRENT_VERSION }} but we trying to build ${{ env.RELEASE_VERSION }}'
} else {
$Output = (git log --pretty=format:'%s by %C(yellow)%an%Creset (%ad)%n %n%b' --date=local --abbrev-commit --max-count=1)
Write-Output ('::notice title=Git output::{0}' -f $Output)
}
- name: Remove other apps
shell: pwsh
if: ${{ success() }}
# rm to remove problem FAP which includes non-existent files
run: |
Remove-Item -Force -Recurse ./applications/debug -ErrorAction SilentlyContinue
Remove-Item -Force -Recurse ./applications/examples -ErrorAction SilentlyContinue
- name: Build Firmware
shell: bash
if: ${{ success() }}
env:
FBT_NO_SYNC: 0
DIST_SUFFIX: ${{ matrix.version }}
WORKFLOW_BRANCH_OR_TAG: release-cfw
run: |
./fbt COMPACT=1 DEBUG=0 FBT_NO_SYNC=0
- name: Build FAPs
shell: bash
if: ${{ success() }}
env:
FBT_NO_SYNC: 0
DIST_SUFFIX: ${{ matrix.version }}
WORKFLOW_BRANCH_OR_TAG: release-cfw
# rm to remove problem FAP which includes non-existent files
run: |
./fbt COMPACT=1 DEBUG=0 FBT_NO_SYNC=0 fap_dist
- name: Create assets
if: ${{ success() }}
shell: pwsh
env:
ZIP_NAME: "${{ vars.FAP_NAME }}_${{ env.RELEASE_VERSION }}_${{ matrix.firmware }}.zip"
TGZ_NAME: "${{ vars.FAP_NAME }}_${{ env.RELEASE_VERSION }}_${{ matrix.firmware }}.tgz"
run: |
function Format-Bytes {
param(
[int]$number
)
$sizes = 'KB', 'MB', 'GB', 'TB', 'PB'
for ($x = 0; $x -lt $sizes.count; $x++) {
if ($number -lt [int64]"1$($sizes[$x])") {
if ($x -eq 0) {
return "$number B"
}
else {
$num = $number / [int64]"1$($sizes[$x-1])"
$num = "{0:N2}" -f $num
return "$num $($sizes[$x-1])"
}
}
}
}
$ZipName = $env:ZIP_NAME
$TgzName = $env:TGZ_NAME
$FapNamme = '${{ vars.FAP_NAME }}.fap'
$DstFap = "./$FapNamme"
$AppDir = "dist/f7-C/apps/Sub-GHz"
if (!(Test-Path -Path "$AppDir/$FapNamme" -PathType Leaf)) {
Write-Error '::error title=Files not found::Cannot find files in location'
exit 1
}
$Size = (Get-Item -Path "$AppDir/$FapNamme" | Get-ItemPropertyValue -Name Length)
Write-Output ('Filesize: {0}' -f (Format-Bytes $Size))
Copy-Item -Force -Verbose -Path "$AppDir/$FapNamme" -Destination $DstFap
zip -r -qq $ZipName $DstFap
tar zcf $TgzName $DstFap
if ( !(Test-Path -Path $ZipName -PathType Leaf) -or !(Test-Path -Path $TgzName -PathType Leaf) ) {
Write-Error '::error title=Files not found::Cannot find files in location'
exit 1
}
$ZipSize = Format-Bytes (Get-Item -Path $ZipName).Length
$TgzSize = Format-Bytes (Get-Item -Path $TgzName ).Length
Write-Output ('ZIP_NAME={0}' -f $ZipName) >> $env:GITHUB_ENV
Write-Output ('TGZ_NAME={0}' -f $TgzName ) >> $env:GITHUB_ENV
Write-Output ('ZIP_TAG={0} ({1})' -f $ZipName, $ZipSize) >> $env:GITHUB_ENV
Write-Output ('TGZ_TAG={0} ({1})' -f $TgzName , $TgzSize) >> $env:GITHUB_ENV
- name: Upload assets
if: ${{ success() && env.ZIP_NAME != '' }}
env:
GITHUB_TOKEN: ${{ secrets.FLIPPER_TOKEN }}
run: |
gh release create v${{ env.RELEASE_VERSION }} --generate-notes --draft -R ${{ env.REPO_SELF }}
gh release upload 'v${{ env.RELEASE_VERSION }}' '${{ env.ZIP_NAME }}#${{ env.ZIP_TAG }}' \
'${{ env.TGZ_NAME }}#${{ env.TGZ_TAG }}' --clobber -R ${{ env.REPO_SELF }}
gh release edit 'v${{ env.RELEASE_VERSION }}' --draft=false -R ${{ env.REPO_SELF }}
#EOF
33 changes: 30 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,34 @@
# ShapShup App for Flipper Zero
---

[![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)
[![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)

<apan style="color: gray">Under construction</span>

![02](https://github.com/derskythe/flipperzero-shapshup/assets/31771569/51ceca37-b322-4926-8b9e-413f616e1922)

---
## Description

A simple application for viewing SubGhz RAW files in the form of a signal level as it is shows in SubGHz RAW read mode.

## Instruction

First you need to select RAW file.<br/>
![01](https://github.com/derskythe/flipperzero-shapshup/assets/31771569/fcd95d16-ff6e-42f9-ae91-890bb1d4e4ee)

Then you can view signal levels of selected file.
You can zoom-in :arrow_down_small: or zoom-out :arrow_up_small: levels

![03](https://github.com/derskythe/flipperzero-shapshup/assets/31771569/d1090ba6-1bf4-46e8-93aa-fbf86512f3cc)

Also you can walk through the file with forward and backward buttons

#### Buttons

| Button | Action |
|:---------------------------:|:---------------------:|
| :arrow_backward: | Go backward |
| :arrow_up_small: | Zoom-out |
| :arrow_forward: | Go forward |
| :arrow_down_small: | Zoom-in |
| :record_button: | Select another file |
| :leftwards_arrow_with_hook: | Long press to EXIT |
Loading

0 comments on commit 687c1a7

Please sign in to comment.