| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- name: UFBT Build and Release
- permissions:
- contents: write
- on:
- push:
- branches:
- - main
- pull_request:
- branches:
- - main
- jobs:
- build:
- name: Build and Test Application
- runs-on: ubuntu-latest
- steps:
- - name: Checkout Repository
- uses: actions/checkout@v3
- - name: Set up Python
- uses: actions/setup-python@v4
- with:
- python-version: '3.x'
- - name: Install UFBT
- run: |
- python3 -m pip install --upgrade pip
- pip install ufbt
- - name: Initialize UFBT Environment
- run: |
- ufbt update
- ufbt vscode_dist
- - name: Build FAP Applications
- run: ufbt faps
- - name: Upload Build Artifacts
- uses: actions/upload-artifact@v3
- with:
- name: build-output
- path: build/
- release:
- name: Create Release
- needs: build
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
- runs-on: ubuntu-latest
- steps:
- - name: Checkout Repository
- uses: actions/checkout@v3
- - name: Extract Version from Manifest
- id: extract_version
- run: |
- VERSION=$(grep '^version:' manifest.yml | awk '{print $2}')
- echo "VERSION=${VERSION}" >> $GITHUB_ENV
- - name: Create Release
- id: create_release
- uses: actions/create-release@v1
- with:
- tag_name: v${{ env.VERSION }}
- release_name: Metroflip v${{ env.VERSION }}
- body: |
- **What's New:**
- $(cat CHANGELOG.md)
- draft: false
- prerelease: false
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- - name: Upload FAP File to Release
- uses: actions/upload-release-asset@v1
- with:
- upload_url: ${{ steps.create_release.outputs.upload_url }}
- asset_path: build/fap/metroflip-${{ env.VERSION }}.fap
- asset_name: metroflip-${{ env.VERSION }}.fap
- asset_content_type: application/octet-stream
|