---
name: Sub-Split Publishing
on:
  push:
    branches:
      - 3.x
  create:
    tags:
      - '3.*'
  delete:
    tags:
      - '3.*'

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: 'frankdejonge:${{ secrets.PERSONAL_ACCESS_TOKEN }}'
          user_name: 'Frank de Jonge'
          user_email: 'info@frenky.net'
      - 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-beta.6
        with:
          source-branch: '3.x'
          config-path: './config.subsplit-publish.json'
          splitsh-path: './.splitsh/splitsh-lite'
          splitsh-version: 'v1.0.1'
