name: deploy

on:
  push:
    branches: [ master ]

jobs:
  no-tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
         persist-credentials: false
         fetch-depth: 0
      - uses: actions/setup-python@v5
      - name: Filter Repository
        run: |
          pip install git-filter-repo
          git-filter-repo --force --path-rename COPYING:.no-test/COPYING && \
          git-filter-repo --path-rename '.no-test/':'simde/' && \
          git-filter-repo --subdirectory-filter simde
      - name: GitHub Push
        uses: ad-m/github-push-action@v0.8.0
        with:
          github_token: ${{ secrets.PUSH_TO_NO_TESTS_TOKEN }}
          repository: simd-everywhere/simde-no-tests

  status:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
      with:
        persist-credentials: false
        fetch-depth: 0
    - uses: actions/checkout@v4
      with:
        fetch-depth: 0
        repository: simd-everywhere/implementation-status
        token: ${{ secrets.PUSH_IMPLEMENTATION_STATUS_TOKEN }}
        path: implementation-status
    - name: Install APT Dependencies
      run: sudo apt-get update && sudo apt-get install -y python3-lxml
    - name: Update
      run: ./implementation-status/scripts/update.sh .
    - uses: EndBug/add-and-commit@v9
      with:
        cwd: implementation-status
        message: Sync with latest SIMDe.
        default_author: github_actions
