mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-22 01:08:11 -07:00
Merge remote-tracking branch 'mntm/dev' into kiisu-mntm
This commit is contained in:
+39
-20
@@ -76,6 +76,29 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: "Configure for Devbuild/PR/Upload"
|
||||
run: |
|
||||
if ${{ secrets.INDEXER_URL == '' }} ; then
|
||||
exit
|
||||
fi
|
||||
if ${{ github.event_name == 'push' }} ; then
|
||||
if ${{ github.ref_name == 'dev' }} ; then
|
||||
SHOULD_DEVBUILD=${{ !contains(github.event.head_commit.message, '--nobuild') }}
|
||||
SHOULD_UPLOAD=$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
|
||||
else
|
||||
echo "What?"
|
||||
exit 1
|
||||
fi
|
||||
echo "SHOULD_DEVBUILD=$SHOULD_DEVBUILD" >> $GITHUB_ENV
|
||||
echo "SHOULD_PRCOMMENT=$SHOULD_PRCOMMENT" >> $GITHUB_ENV
|
||||
echo "SHOULD_UPLOAD=$SHOULD_UPLOAD" >> $GITHUB_ENV
|
||||
|
||||
- name: "Build the firmware and apps"
|
||||
id: build-fw
|
||||
run: |
|
||||
@@ -94,9 +117,7 @@ jobs:
|
||||
dist/${{ env.TARGET }}-*/flipper-z-${{ env.TARGET }}-sdk-*
|
||||
|
||||
- name: "Copy build output"
|
||||
env:
|
||||
INDEXER_URL: ${{ secrets.INDEXER_URL }}
|
||||
if: ${{ env.INDEXER_URL != '' && (github.event.pull_request || (github.event_name == 'push' && ((github.ref_name == 'dev' && !contains(github.event.head_commit.message, '--nobuild')) || startsWith(github.ref, 'refs/tags/')))) }}
|
||||
if: ${{ env.SHOULD_UPLOAD == 'true' }}
|
||||
run: |
|
||||
set -e
|
||||
rm -rf artifacts || true
|
||||
@@ -112,17 +133,13 @@ jobs:
|
||||
echo "VERSION_TAG=$VERSION_TAG" >> $GITHUB_ENV
|
||||
|
||||
- name: "Copy universal artifacts"
|
||||
env:
|
||||
INDEXER_URL: ${{ secrets.INDEXER_URL }}
|
||||
if: ${{ env.INDEXER_URL != '' && (github.event.pull_request || (github.event_name == 'push' && ((github.ref_name == 'dev' && !contains(github.event.head_commit.message, '--nobuild')) || startsWith(github.ref, 'refs/tags/')))) }}
|
||||
if: ${{ env.SHOULD_UPLOAD == 'true' }}
|
||||
run: |
|
||||
tar czpf "artifacts/flipper-z-any-scripts-${SUFFIX}.tgz" scripts
|
||||
cp build/core2_firmware.tgz "artifacts/flipper-z-any-core2_firmware-${SUFFIX}.tgz"
|
||||
|
||||
- name: "Calculate DFU sizes"
|
||||
env:
|
||||
INDEXER_URL: ${{ secrets.INDEXER_URL }}
|
||||
if: ${{ env.INDEXER_URL != '' && github.event.pull_request && matrix.target == env.DEFAULT_TARGET }}
|
||||
if: ${{ env.SHOULD_PRCOMMENT == '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)
|
||||
@@ -145,9 +162,7 @@ jobs:
|
||||
echo "FLASH_USABLE=$FLASH_USABLE" >> $GITHUB_ENV
|
||||
|
||||
- name: "Upload artifacts to update server"
|
||||
env:
|
||||
INDEXER_URL: ${{ secrets.INDEXER_URL }}
|
||||
if: ${{ env.INDEXER_URL != '' && (github.event.pull_request || (github.event_name == 'push' && ((github.ref_name == 'dev' && !contains(github.event.head_commit.message, '--nobuild')) || startsWith(github.ref, 'refs/tags/')))) }}
|
||||
if: ${{ env.SHOULD_UPLOAD == 'true' }}
|
||||
run: |
|
||||
curl "${{ secrets.INDEXER_URL }}"/firmware/directory.json > previndex.json
|
||||
FILES=$(for ARTIFACT in $(find artifacts -maxdepth 1 -not -type d); do echo "-F files=@${ARTIFACT}"; done)
|
||||
@@ -157,10 +172,16 @@ jobs:
|
||||
${FILES[@]} \
|
||||
"${{ secrets.INDEXER_URL }}"/firmware/uploadfiles
|
||||
|
||||
- name: "Force deploy website to refresh devbuilds"
|
||||
if: ${{ env.SHOULD_DEVBUILD == 'true' }}
|
||||
uses: peter-evans/repository-dispatch@v3
|
||||
with:
|
||||
token: ${{ secrets.REPO_DISPATCH_TOKEN }}
|
||||
repository: Next-Flip/v2.momentum-fw.dev
|
||||
event-type: force-deploy
|
||||
|
||||
- name: "Find previous comment"
|
||||
env:
|
||||
INDEXER_URL: ${{ secrets.INDEXER_URL }}
|
||||
if: ${{ env.INDEXER_URL != '' && github.event.pull_request && matrix.target == env.DEFAULT_TARGET }}
|
||||
if: ${{ env.SHOULD_PRCOMMENT == 'true' }}
|
||||
uses: peter-evans/find-comment@v3
|
||||
id: find-comment
|
||||
with:
|
||||
@@ -169,9 +190,7 @@ jobs:
|
||||
body-includes: "Compiled ${{ matrix.target }} firmware for commit"
|
||||
|
||||
- name: "Create or update comment"
|
||||
env:
|
||||
INDEXER_URL: ${{ secrets.INDEXER_URL }}
|
||||
if: ${{ env.INDEXER_URL != '' && github.event.pull_request && matrix.target == env.DEFAULT_TARGET }}
|
||||
if: ${{ env.SHOULD_PRCOMMENT == 'true' }}
|
||||
uses: peter-evans/create-or-update-comment@v4
|
||||
with:
|
||||
comment-id: ${{ steps.find-comment.outputs.comment-id }}
|
||||
@@ -184,10 +203,10 @@ jobs:
|
||||
- Free Flash: `${{ env.FLASH_FREE }}` (`${{ env.FLASH_USABLE }}` usable)
|
||||
edit-mode: replace
|
||||
|
||||
- name: Send devbuild webhook
|
||||
- name: "Send devbuild webhook"
|
||||
env:
|
||||
INDEXER_URL: ${{ secrets.INDEXER_URL }}
|
||||
BUILD_WEBHOOK: ${{ secrets.BUILD_WEBHOOK }}
|
||||
if: ${{ env.INDEXER_URL != '' && github.event_name == 'push' && github.ref_name == 'dev' && !contains(github.event.head_commit.message, '--nobuild') }}
|
||||
if: ${{ env.SHOULD_DEVBUILD == 'true' }}
|
||||
run: |
|
||||
python .github/workflow_data/devbuild.py
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user