Skip to content

Build Quac! 0.6.2 for f7@0.103.1-rc #8408

Build Quac! 0.6.2 for f7@0.103.1-rc

Build Quac! 0.6.2 for f7@0.103.1-rc #8408

Workflow file for this run

name: Build
run-name: Build ${{ inputs.application_name }} ${{ inputs.application_version }} for ${{ inputs.target }}@${{ inputs.branch }}
on:
workflow_dispatch:
inputs:
application_name:
description: "Application name"
required: false
default: Unknown
application_version:
description: "Application version"
required: false
default: Unknown
bundle_url:
description: "Application bundle URL"
required: true
branch:
description: "SDK branch to use"
required: true
target:
description: "SDK hardware target to use"
required: true
upload_url:
description: "Build results submit URL"
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup environment
id: env-setup
run: |
ARCHIVARIUS_URL=$( < .github/.ARCHIVARIUS_URL ) ;
echo "ARCHIVARIUS_URL=${ARCHIVARIUS_URL}" >> $GITHUB_ENV ;
echo "::add-matcher::${{ github.workspace }}/.github/problem-matcher.json" ;
echo "bundle-url=${ARCHIVARIUS_URL}${{ inputs.bundle_url }}" >> $GITHUB_OUTPUT ;
echo "upload-url=${ARCHIVARIUS_URL}${{ inputs.upload_url }}" >> $GITHUB_OUTPUT ;
echo "local-bundle-zip=${{ runner.temp }}/bundle.zip" >> $GITHUB_OUTPUT ;
echo "local-bundle-path=${{ runner.temp }}/app" >> $GITHUB_OUTPUT ;
echo "code-path=${{ runner.temp }}/app/code" >> $GITHUB_OUTPUT ;
- name: Download bundle file
run: |
curl --fail-with-body -L \
-H "Authorization: Bearer ${{ secrets.FAST_AUTH_TOKEN }}" \
-o ${{ steps.env-setup.outputs.local-bundle-zip }} \
${{ steps.env-setup.outputs.bundle-url }}
- name: Unzip src bundle
id: unzip-bundle
run: |
unzip -qq ${{ steps.env-setup.outputs.local-bundle-zip }} -d ${{ steps.env-setup.outputs.local-bundle-path }} ;
APPID=$( grep -e "^id: " "${{ steps.env-setup.outputs.local-bundle-path }}/manifest.yml" | cut -d" " -f2 ) ;
echo "appid=${APPID}" >> $GITHUB_OUTPUT ;
- name: Run ufbt
uses: flipperdevices/flipperzero-ufbt-action@v0.1
continue-on-error: true
id: ufbt
with:
task: build
app-dir: ${{ steps.env-setup.outputs.code-path }}
sdk-branch: ${{ inputs.branch }}
sdk-hw-target: ${{ inputs.target }}
- name: Report build failures
id: report-build-failures
if: steps.ufbt.outputs.build-errors != ''
run: |
cat << "UFBT-ERROR-EOF" > ${{ runner.temp }}/build-errors
${{ steps.ufbt.outputs.build-errors }}
UFBT-ERROR-EOF
curl --fail-with-body \
-H "Authorization: Bearer ${{ secrets.FAST_AUTH_TOKEN }}" \
-F "logs=@${{ runner.temp }}/build-errors" \
-F "github_run_id=${{ github.run_id }}" \
${{ steps.env-setup.outputs.upload-url }}/status/fail ;
exit 1 ;
- name: Zip artifacts
id: zip-artifacts
if: steps.ufbt.outputs.build-errors == ''
run: >
FAP_PATH=$(echo "${{ steps.ufbt.outputs.fap-artifacts }}" | sed 's/ /\n/g' | grep ${{ steps.unzip-bundle.outputs.appid }} | grep -E ".fap$");
FAP_SHA=$( sha256sum $FAP_PATH | cut -d' ' -f1 ) ;
FAP_NAME=$( basename $FAP_PATH ) ;
echo "build-checksum=$FAP_SHA" >> $GITHUB_OUTPUT ;
echo "SHA256 for $FAP_NAME = \`\`\`$FAP_SHA\`\`\`" >> $GITHUB_STEP_SUMMARY ;
zip -qq -r -j ${{ runner.temp }}/build-artifacts.zip $FAP_PATH ;
echo "artifact-path=${{ runner.temp }}/build-artifacts.zip" >> $GITHUB_OUTPUT ;
- name: Upload built files
if: steps.ufbt.outputs.build-errors == ''
run: |
curl --fail-with-body \
-H "Authorization: Bearer ${{ secrets.FAST_AUTH_TOKEN }}" \
-F "build_checksum=${{ steps.zip-artifacts.outputs.build-checksum }}" \
-F "github_run_id=${{ github.run_id }}" \
-F "build=@${{ steps.zip-artifacts.outputs.artifact-path }}" \
${{ steps.env-setup.outputs.upload-url }}