From ed1bcc03b680c8f9d1476a0703167bb790070e65 Mon Sep 17 00:00:00 2001 From: WillyJL Date: Mon, 4 Aug 2025 03:33:53 +0200 Subject: [PATCH] Updates for new website --nobuild --- .github/workflow_data/devbuild.py | 2 +- .github/workflow_data/release.md | 2 +- .github/workflow_data/webhook.py | 41 +++++++++++++++++++++---------- .github/workflows/release.yml | 7 ++++++ ReadMe.md | 5 ++-- 5 files changed, 40 insertions(+), 17 deletions(-) diff --git a/.github/workflow_data/devbuild.py b/.github/workflow_data/devbuild.py index 4a082d958..4044069e3 100644 --- a/.github/workflow_data/devbuild.py +++ b/.github/workflow_data/devbuild.py @@ -61,7 +61,7 @@ if __name__ == "__main__": "name": "Firmware Artifacts:", "value": "\n".join( [ - f"- [🖥️ Install with Web Updater](https://momentum-fw.dev/update)", + f"- [🖥️ Install with Web Updater](https://momentum-fw.dev/update?version={os.environ['VERSION_TAG'].removeprefix('mntm-dev-')})", f"- [☁️ Open in Flipper Lab/App]({artifact_lab})", f"- [🐬 Download Firmware TGZ]({artifact_tgz})", f"- [🛠️ SDK (for development)]({artifact_sdk})", diff --git a/.github/workflow_data/release.md b/.github/workflow_data/release.md index 441896d20..1ebe13765 100644 --- a/.github/workflow_data/release.md +++ b/.github/workflow_data/release.md @@ -1,5 +1,5 @@ ## ⬇️ Download ->### [🖥️ Web Updater (chrome)](https://momentum-fw.dev/update) [recommended] +>### [🖥️ Web Updater (chrome)](https://momentum-fw.dev/update?version={VERSION_TAG}) [recommended] >### [☁️ Flipper Lab/App (chrome/mobile)](https://lab.flipper.net/?url=https://up.momentum-fw.dev/builds/firmware/{VERSION_TAG}/flipper-z-f7-update-{VERSION_TAG}.tgz&channel=release-cfw&version={VERSION_TAG}) diff --git a/.github/workflow_data/webhook.py b/.github/workflow_data/webhook.py index e173ccb7b..70bda300b 100644 --- a/.github/workflow_data/webhook.py +++ b/.github/workflow_data/webhook.py @@ -20,13 +20,15 @@ if __name__ == "__main__": webhook = "BUILD_WEBHOOK" count = len(event["commits"]) if count == 20: - count = int(requests.get( - event["compare"].replace("github.com", "api.github.com/repos"), - headers={ - "Accept": "application/vnd.github.v3+json", - "Authorization": f"token {os.environ['GITHUB_TOKEN']}" - } - ).json()["total_commits"]) + count = int( + requests.get( + event["compare"].replace("github.com", "api.github.com/repos"), + headers={ + "Accept": "application/vnd.github.v3+json", + "Authorization": f"token {os.environ['GITHUB_TOKEN']}", + }, + ).json()["total_commits"] + ) branch = event["ref"].removeprefix("refs/heads/") change = ( "Force Push" @@ -35,7 +37,12 @@ if __name__ == "__main__": ) desc = f"[**{change}**]({event['compare']}) | [{branch}]({event['repository']['html_url']}/tree/{branch})\n" for i, commit in enumerate(event["commits"]): - msg = commit['message'].splitlines()[0].replace("`", "").replace("_", "\_") + msg = ( + commit["message"] + .splitlines()[0] + .replace("`", "") + .replace("_", "\_") + ) msg = msg[:50] + ("..." if len(msg) > 50 else "") desc += f"\n[`{commit['id'][:8]}`]({commit['url']}): {msg} - [__{commit['author'].get('username')}__](https://github.com/{commit['author'].get('username')})" if len(desc) > 2020: @@ -47,9 +54,9 @@ if __name__ == "__main__": case "release": webhook = "RELEASE_WEBHOOK" color = 9471191 - version_tag = event['release']['tag_name'] + version_tag = event["release"]["tag_name"] title = f"New Release: `{version_tag}`!" - desc += f"> 💻 [**Web Installer**](https://momentum-fw.dev/update)\n\n" + desc += f"> 💻 [**Web Installer**](https://momentum-fw.dev/update?version={version_tag})\n\n" desc += f"> 🐬 [**Changelog & Download**](https://github.com/Next-Flip/Momentum-Firmware/releases/tag/{version_tag})\n\n" desc += f"> 🛞 [**Project Page**](https://github.com/Next-Flip/Momentum-Firmware)" @@ -75,7 +82,11 @@ if __name__ == "__main__": title = f"Issue {event['action'].title()}: {name}" match event["action"]: case "opened": - desc = (issue["body"][:2045] + "...") if len(issue["body"]) > 2048 else issue["body"] + desc = ( + (issue["body"][:2045] + "...") + if len(issue["body"]) > 2048 + else issue["body"] + ) color = 3669797 case "closed": color = 16723712 @@ -90,7 +101,11 @@ if __name__ == "__main__": url = comment["html_url"] title = f"New Comment on Issue: {issue['title']}" color = 3669797 - desc = (comment["body"][:2045] + "...") if len(comment["body"]) > 2048 else comment["body"] + desc = ( + (comment["body"][:2045] + "...") + if len(comment["body"]) > 2048 + else comment["body"] + ) case _: sys.exit(1) @@ -112,7 +127,7 @@ if __name__ == "__main__": "url": event["sender"]["html_url"], "icon_url": event["sender"]["avatar_url"], }, - "timestamp": dt.datetime.utcnow().isoformat() + "timestamp": dt.datetime.utcnow().isoformat(), } ], "attachments": [], diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 03c3b0236..65a353298 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,6 +45,13 @@ jobs: curl --fail -L -H "Token: ${{ secrets.INDEXER_TOKEN }}" \ "${{ secrets.INDEXER_URL }}"/firmware/reindex; + - name: "Force deploy website to refresh releases" + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.REPO_DISPATCH_TOKEN }} + repository: Next-Flip/v2.momentum-fw.dev + event-type: force-deploy + - name: "Send release notification" env: RELEASE_WEBHOOK: ${{ secrets.RELEASE_WEBHOOK }} diff --git a/ReadMe.md b/ReadMe.md index 46fc2f7f8..5c15a535b 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -86,7 +86,7 @@ In USB mode it also enables additional functionality to spoof the manufacturer a

List of changes

-There are too many to name them all, this is a **non-comprehensive** list of the **most notable from an end-user perspective**. For a more detailed list, you can read through the [**changelogs**](https://github.com/Next-Flip/Momentum-Firmware/releases) and commits/code. Also, you can find a **feature comparison with other firmwares** on [our website](https://momentum-fw.dev/#features). +There are too many to name them all, this is a **non-comprehensive** list of the **most notable from an end-user perspective**. For a more detailed list, you can read through the [**changelogs**](https://github.com/Next-Flip/Momentum-Firmware/releases) and commits/code. Also, you can find a **feature comparison with other firmwares** on [our website](https://momentum-fw.dev/). Note that this repo is always updated with the great work from our friends at [Unleashed](https://github.com/DarkFlippers/unleashed-firmware) and the latest changes from [OFW](https://github.com/flipperdevices/flipperzero-firmware). Below are mentioned only **our** changes that we can actually be credited for, so make sure to check their fantastic additions aswell. And a huge thank you to both teams! @@ -143,7 +143,8 @@ There are 4 methods to install Momentum, we recommend you use the **Web Updater* >
  • Make sure qFlipper is closed
  • >
  • Open the Web Updater
  • >
  • Click Connect and select your Flipper from the list
  • ->
  • Click Flash and wait for the update to complete
  • +>
  • Select which update Channel you prefer from the dropdown
  • +>
  • Click Install and wait for the update to complete
  • > >
    Flipper Lab/App (chrome/mobile)