name: Build facebooknoseen

on:
  push:
    branches: [ "main" ]
    paths:
      - 'Tweak.xm'
      - 'Makefile'
      - 'control'
      - '.github/workflows/build.yml'
  workflow_dispatch:

jobs:
  build:
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Theos
        run: |
          git clone --recursive https://github.com/theos/theos.git /tmp/theos
          curl -fsSL https://github.com/ProcursusTeam/ldid/releases/download/v2.1.5-procursus7/ldid_macosx_x86_64 -o /tmp/theos/bin/ldid
          chmod +x /tmp/theos/bin/ldid
          echo "THEOS=/tmp/theos" >> $GITHUB_ENV

      - name: Build
        run: |
          make clean package THEOS=/tmp/theos

      - name: Upload .deb
        uses: actions/upload-artifact@v4
        with:
          name: facebooknoseen-deb
          path: packages/*.deb
