mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-25 03:29:58 -07:00
71 lines
1.8 KiB
YAML
71 lines
1.8 KiB
YAML
name: 'Build artifact'
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
- main
|
|
tags:
|
|
- '*'
|
|
pull_request:
|
|
|
|
env:
|
|
TARGETS: f7
|
|
DEFAULT_TARGET: f7
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: 'Checkout code'
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
- name: 'Build the firmware'
|
|
run: |
|
|
set -e
|
|
for TARGET in ${TARGETS}; do
|
|
TARGET="$(echo "${TARGET}" | sed 's/f//')"; \
|
|
./fbt TARGET_HW=$TARGET updater_package
|
|
done
|
|
|
|
- name: "Check for uncommitted changes"
|
|
run: |
|
|
git diff --exit-code
|
|
|
|
- name: 'Updater artifact'
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: updater
|
|
path: |
|
|
dist/${{ env.DEFAULT_TARGET }}-*
|
|
|
|
# - name: 'Find Previous Comment'
|
|
# if: ${{ github.event.pull_request }}
|
|
# uses: peter-evans/find-comment@v1
|
|
# id: fc
|
|
# with:
|
|
# issue-number: ${{ github.event.pull_request.number }}
|
|
# comment-author: 'github-actions[bot]'
|
|
# body-includes: 'Compiled firmware:'
|
|
|
|
# - name: Artifact info
|
|
# id: artifact-info
|
|
# uses: dawidd6/action-download-artifact@v2
|
|
# with:
|
|
# dry_run: true
|
|
|
|
# - name: 'Create or update comment'
|
|
# if: ${{ github.event.pull_request}}
|
|
# uses: peter-evans/create-or-update-comment@v1
|
|
# with:
|
|
# comment-id: ${{ steps.fc.outputs.comment-id }}
|
|
# issue-number: ${{ github.event.pull_request.number }}
|
|
# body: |
|
|
# **Compiled firmware:**
|
|
# - [📦 Update package](${{steps.artifact-info.outputs.artifacts[0].archive_download_url}})
|
|
# edit-mode: replace
|