|
@@ -1,6 +1,6 @@
|
|
|
name: 'Build'
|
|
name: 'Build'
|
|
|
|
|
|
|
|
-on:
|
|
|
|
|
|
|
+on:
|
|
|
push:
|
|
push:
|
|
|
branches:
|
|
branches:
|
|
|
- dev
|
|
- dev
|
|
@@ -14,8 +14,8 @@ env:
|
|
|
DEFAULT_TARGET: f7
|
|
DEFAULT_TARGET: f7
|
|
|
|
|
|
|
|
jobs:
|
|
jobs:
|
|
|
- build:
|
|
|
|
|
- runs-on: [self-hosted]
|
|
|
|
|
|
|
+ main:
|
|
|
|
|
+ runs-on: [self-hosted,Office]
|
|
|
steps:
|
|
steps:
|
|
|
- name: 'Cleanup workspace'
|
|
- name: 'Cleanup workspace'
|
|
|
uses: AutoModality/action-clean@v1
|
|
uses: AutoModality/action-clean@v1
|
|
@@ -35,13 +35,6 @@ jobs:
|
|
|
submodules: true
|
|
submodules: true
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
|
|
|
|
- - name: 'Docker cache'
|
|
|
|
|
- uses: satackey/action-docker-layer-caching@v0.0.11
|
|
|
|
|
- continue-on-error: true
|
|
|
|
|
- with:
|
|
|
|
|
- key: docker-cache-${{ hashFiles('docker/**') }}-{hash}
|
|
|
|
|
- restore-keys: docker-cache-${{ hashFiles('docker/**') }}-
|
|
|
|
|
-
|
|
|
|
|
- name: 'Build docker image'
|
|
- name: 'Build docker image'
|
|
|
uses: ./.github/actions/docker
|
|
uses: ./.github/actions/docker
|
|
|
|
|
|
|
@@ -85,7 +78,7 @@ jobs:
|
|
|
set -e
|
|
set -e
|
|
|
for TARGET in ${TARGETS}
|
|
for TARGET in ${TARGETS}
|
|
|
do
|
|
do
|
|
|
- make TARGET=${TARGET}
|
|
|
|
|
|
|
+ make TARGET=${TARGET} ${{ startsWith(github.ref, 'refs/tags') && 'DEBUG=0 COMPACT=1' || '' }}
|
|
|
done
|
|
done
|
|
|
|
|
|
|
|
- name: 'Move upload files'
|
|
- name: 'Move upload files'
|
|
@@ -149,3 +142,56 @@ jobs:
|
|
|
body: |
|
|
body: |
|
|
|
[Click here](https://update.flipperzero.one/?url=https://update.flipperzero.one/builds/firmware/${{steps.names.outputs.artifacts-path}}/flipper-z-${{steps.names.outputs.default-target}}-full-${{steps.names.outputs.suffix}}.dfu&channel=${{steps.names.outputs.artifacts-path}}&version=${{steps.names.outputs.short-hash}}&target=${{steps.names.outputs.default-target}}) to flash the `${{steps.names.outputs.short-hash}}` version of this branch via WebUSB.
|
|
[Click here](https://update.flipperzero.one/?url=https://update.flipperzero.one/builds/firmware/${{steps.names.outputs.artifacts-path}}/flipper-z-${{steps.names.outputs.default-target}}-full-${{steps.names.outputs.suffix}}.dfu&channel=${{steps.names.outputs.artifacts-path}}&version=${{steps.names.outputs.short-hash}}&target=${{steps.names.outputs.default-target}}) to flash the `${{steps.names.outputs.short-hash}}` version of this branch via WebUSB.
|
|
|
edit-mode: replace
|
|
edit-mode: replace
|
|
|
|
|
+ compact:
|
|
|
|
|
+ if: ${{ !startsWith(github.ref, 'refs/tags') }}
|
|
|
|
|
+ runs-on: [self-hosted,koteeq]
|
|
|
|
|
+ steps:
|
|
|
|
|
+ - name: 'Cleanup workspace'
|
|
|
|
|
+ uses: AutoModality/action-clean@v1
|
|
|
|
|
+
|
|
|
|
|
+ - name: 'Decontaminate previous build leftovers'
|
|
|
|
|
+ run: |
|
|
|
|
|
+ if [ -d .git ]
|
|
|
|
|
+ then
|
|
|
|
|
+ git submodule status \
|
|
|
|
|
+ || git checkout `git rev-list --max-parents=0 HEAD | tail -n 1`
|
|
|
|
|
+ fi
|
|
|
|
|
+
|
|
|
|
|
+ - name: 'Checkout code'
|
|
|
|
|
+ uses: actions/checkout@v2
|
|
|
|
|
+ with:
|
|
|
|
|
+ fetch-depth: 0
|
|
|
|
|
+ submodules: true
|
|
|
|
|
+ ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
|
+
|
|
|
|
|
+ - name: 'Build docker image'
|
|
|
|
|
+ uses: ./.github/actions/docker
|
|
|
|
|
+
|
|
|
|
|
+ - name: 'Generate suffix and folder name'
|
|
|
|
|
+ id: names
|
|
|
|
|
+ run: |
|
|
|
|
|
+ REF=${{ github.ref }}
|
|
|
|
|
+ if [[ ${{ github.event_name }} == 'pull_request' ]]; then
|
|
|
|
|
+ REF=${{ github.head_ref }}
|
|
|
|
|
+ fi
|
|
|
|
|
+ BRANCH_OR_TAG=${REF#refs/*/}
|
|
|
|
|
+ SHA=$(git rev-parse --short HEAD)
|
|
|
|
|
+
|
|
|
|
|
+ if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
|
|
|
|
|
+ SUFFIX=${BRANCH_OR_TAG//\//_}
|
|
|
|
|
+ else
|
|
|
|
|
+ SUFFIX=${BRANCH_OR_TAG//\//_}-$(date +'%d%m%Y')-${SHA}
|
|
|
|
|
+ fi
|
|
|
|
|
+
|
|
|
|
|
+ echo "WORKFLOW_BRANCH_OR_TAG=${BRANCH_OR_TAG}" >> $GITHUB_ENV
|
|
|
|
|
+ echo "DIST_SUFFIX=${SUFFIX}" >> $GITHUB_ENV
|
|
|
|
|
+
|
|
|
|
|
+ - name: 'Build the firmware in docker'
|
|
|
|
|
+ uses: ./.github/actions/docker
|
|
|
|
|
+ with:
|
|
|
|
|
+ run: |
|
|
|
|
|
+ set -e
|
|
|
|
|
+ for TARGET in ${TARGETS}
|
|
|
|
|
+ do
|
|
|
|
|
+ make TARGET=${TARGET} DEBUG=0 COMPACT=1
|
|
|
|
|
+ done
|