---
name: Sub-Split Publishing
on:
    push:
        branches:
            - master
    create:
        tags:
            - '7.*'
    delete:
        tags:
            - '7.*'

jobs:
    publish_subsplits:
        runs-on: ubuntu-latest
        name: Publish package sub-splits
        steps:
            - uses: actions/checkout@v3
              with:
                  fetch-depth: '0'
                  persist-credentials: 'false'
            - uses: frankdejonge/use-github-token@1.0.2
              with:
                  authentication: 'nyamsprod:${{ secrets.PERSONAL_ACCESS_TOKEN }}'
                  user_name: 'ignace nyamagana butera'
                  user_email: 'nyamsprod@gmail.com'
            - name: Cache splitsh-lite
              id: splitsh-cache
              uses: actions/cache@v3
              with:
                  path: './.splitsh'
                  key: '${{ runner.os }}-splitsh'
            - uses: frankdejonge/use-subsplit-publish@1.0.0
              with:
                  source-branch: 'master'
                  config-path: './config.subsplit-publish.json'
                  splitsh-path: './.splitsh/splitsh-lite'
                  splitsh-version: 'v1.0.1'
