<commit_before>name: Publish release

on:
  push:
    tags:
      - 'v*'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Use PHP 7.4
        uses: shivammathur/setup-php@v2
        with:
          php-version: '7.4' # Publish release with lowest supported PHP version
          tools: composer
          extensions: swoole-4.6.3
      - name: Generate release assets
        run: ./build.sh ${GITHUB_REF#refs/tags/v}
      - name: Publish release with assets
        uses: docker://antonyurchenko/git-release:latest
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          ALLOW_TAG_PREFIX: "true"
          ALLOW_EMPTY_CHANGELOG: "true"
        with:
          args: |
            build/shlink_*_dist.zip<commit_msg>Improved publish-release workflow to generate files for all supported PHP versions and with/without swoole<commit_after>name: Publish release

on:
  push:
    tags:
      - 'v*'

jobs:
  build:
    runs-on: ubuntu-20.04
    strategy:
      matrix:
        php-version: ['7.4', '8.0']
        swoole: ['yes', 'no']
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Use PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php-version }}
          tools: composer
          extensions: swoole-4.6.3
      - if: ${{ matrix.swoole == 'yes' }}
        run: ./build.sh ${GITHUB_REF#refs/tags/v}
      - if: ${{ matrix.swoole == 'no' }}
        run: ./build.sh ${GITHUB_REF#refs/tags/v} --no-swoole
      - uses: actions/upload-artifact@v2
        with:
          name: dist-files
          path: build

  publish:
    needs: ['build']
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/download-artifact@v2
        with:
          path: build
      - name: Publish release with assets
        uses: docker://antonyurchenko/git-release:latest
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          ALLOW_TAG_PREFIX: "true"
          ALLOW_EMPTY_CHANGELOG: "true"
        with:
          args: |
            build/shlink*_dist.zip

  delete-artifacts:
    needs: ['publish']
    runs-on: ubuntu-20.04
    steps:
      - uses: geekyeggo/delete-artifact@v1
        with:
          name: dist-files
{'fraction_non_alphanumeric': 0.11785095320623917, 'fraction_numerical': 0.014298093587521665, 'mean_word_length': 1.8400984009840098, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '232693', 'n_tokens_mistral': 786, 'n_tokens_neox': 769, 'n_words': 169}