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
Connect and select your Flipper from the listFlash and wait for the update to completeChannel you prefer from the dropdownInstall and wait for the update to completeFlipper Lab/App (chrome/mobile)