mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-21 00:58:10 -07:00
Merge remote-tracking branch 'mntm/dev' into kiisu-mntm
This commit is contained in:
+28
-24
@@ -62,14 +62,14 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: "Check API version for consistency with OFW release-candidate"
|
||||
- name: "Check API version for consistency with OFW release channel"
|
||||
run: |
|
||||
set -e
|
||||
symbols="targets/$TARGET/api_symbols.csv"
|
||||
ofw_api="$(curl -s "https://raw.githubusercontent.com/flipperdevices/flipperzero-firmware/release-candidate/${symbols}" | head -n2)"
|
||||
ofw_api="$(curl -s "https://raw.githubusercontent.com/flipperdevices/flipperzero-firmware/release/${symbols}" | head -n2)"
|
||||
our_api="$(head -n2 "${symbols}")"
|
||||
if [ "$our_api" != "$ofw_api" ] ; then
|
||||
echo API versions aren\'t matching OFW. Please update!
|
||||
echo API versions aren\'t matching OFW release channel. Please update!
|
||||
echo API versions are:
|
||||
echo "Official: $(tail -n1 <<< "$ofw_api")"
|
||||
echo "Momentum: $(tail -n1 <<< "$our_api")"
|
||||
@@ -85,19 +85,22 @@ jobs:
|
||||
if ${{ github.ref_name == 'dev' }} ; then
|
||||
SHOULD_DEVBUILD=${{ !contains(github.event.head_commit.message, '--nobuild') }}
|
||||
SHOULD_UPLOAD=$SHOULD_DEVBUILD
|
||||
SHOULD_DEPLOY=$SHOULD_DEVBUILD
|
||||
elif ${{ startsWith(github.ref, 'refs/tags/') }} ; then
|
||||
SHOULD_UPLOAD=true
|
||||
fi
|
||||
elif ${{ !!github.event.pull_request }} ; then
|
||||
SHOULD_PRCOMMENT=${{ matrix.target == env.DEFAULT_TARGET }}
|
||||
SHOULD_UPLOAD=true
|
||||
SHOULD_PRBUILD=${{ matrix.target == env.DEFAULT_TARGET }}
|
||||
SHOULD_UPLOAD=$SHOULD_PRBUILD
|
||||
SHOULD_DEPLOY=$SHOULD_PRBUILD
|
||||
else
|
||||
echo "What?"
|
||||
exit 1
|
||||
fi
|
||||
echo "SHOULD_DEVBUILD=$SHOULD_DEVBUILD" >> $GITHUB_ENV
|
||||
echo "SHOULD_PRCOMMENT=$SHOULD_PRCOMMENT" >> $GITHUB_ENV
|
||||
echo "SHOULD_PRBUILD=$SHOULD_PRBUILD" >> $GITHUB_ENV
|
||||
echo "SHOULD_UPLOAD=$SHOULD_UPLOAD" >> $GITHUB_ENV
|
||||
echo "SHOULD_DEPLOY=$SHOULD_DEPLOY" >> $GITHUB_ENV
|
||||
|
||||
- name: "Build the firmware and apps"
|
||||
id: build-fw
|
||||
@@ -150,7 +153,7 @@ jobs:
|
||||
"${{ secrets.INDEXER_URL }}"/firmware/uploadfiles
|
||||
|
||||
- name: "Force deploy website to refresh devbuilds"
|
||||
if: ${{ env.SHOULD_DEVBUILD == 'true' }}
|
||||
if: ${{ env.SHOULD_DEPLOY == 'true' }}
|
||||
uses: Codex-/return-dispatch@v2
|
||||
id: force-deploy
|
||||
with:
|
||||
@@ -163,7 +166,7 @@ jobs:
|
||||
workflow_job_steps_retry_seconds: 5
|
||||
|
||||
- name: "Calculate DFU sizes"
|
||||
if: ${{ env.SHOULD_PRCOMMENT == 'true' }}
|
||||
if: ${{ env.SHOULD_PRBUILD == 'true' }}
|
||||
run: |
|
||||
curl -L "${{ secrets.INDEXER_URL }}"/firmware/development/f7/full_dfu -o dev.dfu
|
||||
dfu_size_new=$(du --apparent-size -B 1 artifacts/flipper-z-${TARGET}-full-*.dfu | cut -f1)
|
||||
@@ -186,7 +189,7 @@ jobs:
|
||||
echo "FLASH_USABLE=$FLASH_USABLE" >> $GITHUB_ENV
|
||||
|
||||
- name: "Find previous comment"
|
||||
if: ${{ env.SHOULD_PRCOMMENT == 'true' }}
|
||||
if: ${{ env.SHOULD_PRBUILD == 'true' }}
|
||||
uses: peter-evans/find-comment@v3
|
||||
id: find-comment
|
||||
with:
|
||||
@@ -194,22 +197,8 @@ jobs:
|
||||
comment-author: "github-actions[bot]"
|
||||
body-includes: "Compiled ${{ matrix.target }} firmware for commit"
|
||||
|
||||
- name: "Create or update comment"
|
||||
if: ${{ env.SHOULD_PRCOMMENT == '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_DEVBUILD == 'true' }}
|
||||
if: ${{ env.SHOULD_DEPLOY == 'true' }}
|
||||
uses: Codex-/await-remote-run@v1
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
@@ -219,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 }}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
name: "PR Cleanup"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- closed
|
||||
|
||||
jobs:
|
||||
pr-cleanup:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Configure for Reindex"
|
||||
run: |
|
||||
if ${{ secrets.INDEXER_URL == '' }} ; then
|
||||
exit
|
||||
fi
|
||||
if ${{ !!github.event.pull_request }} ; then
|
||||
SHOULD_REINDEX=${{ github.event.action == 'closed' }}
|
||||
else
|
||||
echo "What?"
|
||||
exit 1
|
||||
fi
|
||||
echo "SHOULD_REINDEX=$SHOULD_REINDEX" >> $GITHUB_ENV
|
||||
|
||||
- name: "Trigger reindex"
|
||||
if: ${{ env.SHOULD_REINDEX == 'true' }}
|
||||
run: |
|
||||
curl --fail -L -H "Token: ${{ secrets.INDEXER_TOKEN }}" \
|
||||
"${{ secrets.INDEXER_URL }}"/firmware/reindex
|
||||
|
||||
- name: "Force deploy website to refresh branches"
|
||||
if: ${{ env.SHOULD_REINDEX == 'true' }}
|
||||
uses: Codex-/return-dispatch@v2
|
||||
id: force-deploy
|
||||
with:
|
||||
token: ${{ secrets.REPO_DISPATCH_TOKEN }}
|
||||
ref: dev
|
||||
repo: v2.momentum-fw.dev
|
||||
owner: Next-Flip
|
||||
workflow: force-deploy.yml
|
||||
workflow_timeout_seconds: 300
|
||||
workflow_job_steps_retry_seconds: 5
|
||||
|
||||
- name: "Wait for deploy (Run ID ${{ steps.force-deploy.outputs.run_id }})"
|
||||
if: ${{ env.SHOULD_REINDEX == 'true' }}
|
||||
uses: Codex-/await-remote-run@v1
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
repo: v2.momentum-fw.dev
|
||||
owner: Next-Flip
|
||||
run_id: ${{ steps.force-deploy.outputs.run_id }}
|
||||
run_timeout_seconds: 300
|
||||
poll_interval_ms: 5000
|
||||
Reference in New Issue
Block a user