build&push.yml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. name: Upload FAP
  2. on:
  3. workflow_dispatch:
  4. jobs:
  5. build-and-upload:
  6. runs-on: ubuntu-latest
  7. steps:
  8. - name: Checkout code
  9. uses: actions/checkout@v3
  10. - name: Set up dependencies
  11. run: |
  12. sudo apt-get install gh
  13. echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
  14. - name: Build FAP
  15. run: |
  16. # Build command here
  17. echo "Build completed"
  18. - name: Delete existing asset if it exists
  19. run: |
  20. ASSET_ID=$(gh api repos/luu176/Metroflip/releases/192702667/assets | jq '.[] | select(.name=="metroflip.fap") | .id')
  21. if [ -n "$ASSET_ID" ]; then
  22. echo "Deleting existing asset with ID $ASSET_ID"
  23. gh api --method DELETE repos/luu176/Metroflip/releases/assets/$ASSET_ID
  24. fi
  25. - name: Upload FAP
  26. uses: actions/upload-release-asset@v1
  27. with:
  28. upload_url: https://uploads.github.com/repos/luu176/Metroflip/releases/192702667/assets
  29. asset_path: /home/runner/.ufbt/build/metroflip.fap
  30. asset_name: metroflip.fap
  31. asset_content_type: application/octet-stream