main.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: UFBT Build and Test
  2. on:
  3. push:
  4. branches:
  5. - main
  6. pull_request:
  7. branches:
  8. - main
  9. jobs:
  10. build:
  11. name: Build and Test Application
  12. runs-on: ubuntu-latest
  13. steps:
  14. - name: Checkout Repository
  15. uses: actions/checkout@v3
  16. - name: Set up Python
  17. uses: actions/setup-python@v4
  18. with:
  19. python-version: '3.x'
  20. - name: Install UFBT
  21. run: |
  22. python3 -m pip install --upgrade pip
  23. pip install ufbt
  24. - name: Initialize UFBT Environment
  25. run: |
  26. ufbt update
  27. ufbt vscode_dist
  28. - name: Build FAP Applications
  29. run: ufbt faps
  30. - name: Get Release Information
  31. id: release
  32. run: |
  33. REPO="luu176/Metroflip" # Change this to your repository name
  34. VERSION="v0.4.0" # Specify your version
  35. RELEASE=$(curl -s "https://api.github.com/repos/$REPO/releases/tags/$VERSION")
  36. echo "::set-output name=upload_url::$(echo $RELEASE | jq -r .upload_url | sed -e "s/{?name,label}//")"
  37. - name: Upload FAP to Existing Release
  38. uses: actions/upload-release-asset@v1
  39. with:
  40. upload_url: ${{ steps.release.outputs.upload_url }}
  41. asset_path: /home/runner/.ufbt/build/metroflip.fap
  42. asset_name: metroflip-${{ github.run_id }}.fap
  43. asset_content_type: application/octet-stream