mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-06-20 20:38:24 -07:00
CI: Web Updater link in PR comment --nobuild
This commit is contained in:
+15
-14
@@ -197,20 +197,6 @@ jobs:
|
||||
comment-author: "github-actions[bot]"
|
||||
body-includes: "Compiled ${{ matrix.target }} firmware for commit"
|
||||
|
||||
- name: "Create or update comment"
|
||||
if: ${{ env.SHOULD_PRBUILD == 'true' }}
|
||||
uses: peter-evans/create-or-update-comment@v4
|
||||
with:
|
||||
comment-id: ${{ steps.find-comment.outputs.comment-id }}
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
body: |
|
||||
**Compiled ${{ matrix.target }} firmware for commit `${{steps.names.outputs.commit_sha}}`:**
|
||||
- [☁️ Flipper Lab/App](https://lab.flipper.net/?url=${{secrets.INDEXER_URL}}/builds/firmware/${{steps.names.outputs.branch_name}}/flipper-z-${{steps.names.outputs.default_target}}-update-${{steps.names.outputs.suffix}}.tgz&channel=mntm-${{steps.names.outputs.branch_name}}&version=${{steps.names.outputs.commit_sha}})
|
||||
- [📦 qFlipper Package](${{secrets.INDEXER_URL}}/builds/firmware/${{steps.names.outputs.branch_name}}/flipper-z-${{steps.names.outputs.default_target}}-update-${{steps.names.outputs.suffix}}.tgz)
|
||||
- DFU Size: `${{ env.DFU_SIZE }}` (`${{ env.DFU_DIFF }}` from dev)
|
||||
- Free Flash: `${{ env.FLASH_FREE }}` (`${{ env.FLASH_USABLE }}` usable)
|
||||
edit-mode: replace
|
||||
|
||||
- name: "Wait for deploy (Run ID ${{ steps.force-deploy.outputs.run_id }})"
|
||||
if: ${{ env.SHOULD_DEPLOY == 'true' }}
|
||||
uses: Codex-/await-remote-run@v1
|
||||
@@ -222,6 +208,21 @@ jobs:
|
||||
run_timeout_seconds: 300
|
||||
poll_interval_ms: 5000
|
||||
|
||||
- name: "Create or update comment"
|
||||
if: ${{ env.SHOULD_PRBUILD == 'true' }}
|
||||
uses: peter-evans/create-or-update-comment@v4
|
||||
with:
|
||||
comment-id: ${{ steps.find-comment.outputs.comment-id }}
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
body: |
|
||||
**Compiled ${{ matrix.target }} firmware for commit `${{steps.names.outputs.commit_sha}}`:**
|
||||
- [🖥️ Web Updater](https://momentum-fw.dev/update?branch=${{steps.names.outputs.branch_name_urlencoded}})
|
||||
- [☁️ Flipper Lab/App](https://lab.flipper.net/?url=${{secrets.INDEXER_URL}}/builds/firmware/${{steps.names.outputs.branch_name}}/flipper-z-${{steps.names.outputs.default_target}}-update-${{steps.names.outputs.suffix}}.tgz&channel=mntm-${{steps.names.outputs.branch_name}}&version=${{steps.names.outputs.commit_sha}})
|
||||
- [📦 qFlipper Package](${{secrets.INDEXER_URL}}/builds/firmware/${{steps.names.outputs.branch_name}}/flipper-z-${{steps.names.outputs.default_target}}-update-${{steps.names.outputs.suffix}}.tgz)
|
||||
- DFU Size: `${{ env.DFU_SIZE }}` (`${{ env.DFU_DIFF }}` from dev)
|
||||
- Free Flash: `${{ env.FLASH_FREE }}` (`${{ env.FLASH_USABLE }}` usable)
|
||||
edit-mode: replace
|
||||
|
||||
- name: "Send devbuild webhook"
|
||||
env:
|
||||
INDEXER_URL: ${{ secrets.INDEXER_URL }}
|
||||
|
||||
@@ -9,6 +9,7 @@ import re
|
||||
import shlex
|
||||
import ssl
|
||||
import string
|
||||
import urllib.parse
|
||||
import urllib.request
|
||||
|
||||
|
||||
@@ -63,6 +64,7 @@ def get_details(event, args):
|
||||
ref = event["ref"]
|
||||
data["commit_sha"] = data["commit_hash"][:8]
|
||||
data["branch_name"] = re.sub("refs/\w+/", "", ref)
|
||||
data["branch_name_urlencoded"] = urllib.parse.quote_plus(data["branch_name"])
|
||||
data["suffix"] = (
|
||||
"mntm-"
|
||||
+ data["branch_name"].removeprefix("mntm-").replace("/", "-")
|
||||
@@ -94,6 +96,9 @@ def add_envs(data, gh_env_file, gh_out_file, args):
|
||||
add_env("DIST_SUFFIX", data["suffix"], gh_env_file)
|
||||
add_env("WORKFLOW_BRANCH_OR_TAG", data["branch_name"], gh_env_file)
|
||||
add_set_output_var("branch_name", data["branch_name"], gh_out_file)
|
||||
add_set_output_var(
|
||||
"branch_name_urlencoded", data["branch_name_urlencoded"], gh_out_file
|
||||
)
|
||||
add_set_output_var("commit_sha", data["commit_sha"], gh_out_file)
|
||||
add_set_output_var("default_target", os.getenv("DEFAULT_TARGET"), gh_out_file)
|
||||
add_set_output_var("suffix", data["suffix"], gh_out_file)
|
||||
|
||||
Reference in New Issue
Block a user