<commit_before>name: Package
on:
  push:
    branches:
      - master
      - 'maintenance/**'
    tags:
      - '*'
  pull_request:
  schedule:
    - cron: |
        0 0 * * *
concurrency:
  group: ${{ github.head_ref || github.sha }}-${{ github.workflow }}
  cancel-in-progress: true
jobs:
  build:
    name: Build
    strategy:
      fail-fast: false
      matrix:
        label:
          - Debian GNU/Linux bullseye amd64
          - Debian GNU/Linux bullseye arm64
          - Debian GNU/Linux buster amd64
          - Debian GNU/Linux buster arm64
          - Debian GNU/Linux buster i386
          - CentOS 7
          - CentOS 8
          - AlmaLinux 8
        include:
          - label: Debian GNU/Linux bullseye amd64
            id: debian-bullseye-amd64
            task-namespace: apt
            target: debian-bullseye
            test-docker-image: debian:bullseye
          - label: Debian GNU/Linux bullseye arm64
            id: debian-bullseye-arm64
            task-namespace: apt
            target: debian-bullseye-arm64
            test-docker-image: arm64v8/debian:bullseye
          - label: Debian GNU/Linux buster amd64
            id: debian-buster-amd64
            task-namespace: apt
            target: debian-buster
            test-docker-image: debian:buster
          - label: Debian GNU/Linux buster arm64
            id: debian-buster-arm64
            task-namespace: apt
            target: debian-buster-arm64
            test-docker-image: arm64v8/debian:buster
          - label: Debian GNU/Linux buster i386
            id: debian-buster-i386
            task-namespace: apt
            target: debian-buster-i386
            test-docker-image: i386/debian:buster
          - label: CentOS 7
            id: centos-7
            task-namespace: yum
            target: centos-7
            test-docker-image: centos:7
          - label: CentOS 8
            id: centos-8
            task-namespace: yum
            target: centos-8
            test-docker-image: centos:8
          - label: AlmaLinux 8
            id: almalinux-8
            task-namespace: yum
            target: almalinux-8
            test-docker-image: almalinux:8
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: recursive
      - name: Install dependencies
        run: |
          sudo apt update
          sudo apt -V install \
            autoconf-archive \
            devscripts \
            python3-pip \
            ruby
      # qemu-user-static in Ubuntu 20.04 has the following bug.
      # https://bugs.launchpad.net/qemu/+bug/1749393
      # This bug has already fixed in Ubuntu 20.10.
      # However, this fix is not included in Ubuntu 20.04.
      # Therefore, we temporaly use qemu-user-static in Ubuntu 20.10.
      # We remove this step when qemu-user-static in Ubuntu 20.04 will include above remediation.
      - name: Install QEMU from Groovy
        run: |
          sudo tee /etc/apt/preferences.d/qemu <<EOF
          Package: *
          Pin: release n=focal
          Pin-Priority: 900
          Package: *
          Pin: release n=groovy
          Pin-Priority: 400
          EOF
          sudo tee /etc/apt/sources.list.d/groovy.list <<EOF
          deb http://jp.archive.ubuntu.com/ubuntu groovy universe
          deb http://jp.archive.ubuntu.com/ubuntu groovy-updates universe
          deb http://security.ubuntu.com/ubuntu groovy-security universe
          EOF
          sudo apt update
          sudo apt install -t groovy qemu-user-static
      - name: Install Sphinx
        run: |
          sudo pip3 install -v sphinx
      - name: Clone dependencies
        run: |
          cd ..
          git clone --depth 1 https://github.com/groonga/groonga.org.git
          git clone --depth 1 https://github.com/clear-code/cutter.git
      - name: Generate configure
        run: |
          ./autogen.sh
      - name: Configure for archive
        run: |
          ./configure \
            --enable-document \
            --enable-mruby \
            --with-cutter-source-path=../cutter \
            --with-groonga-org-path=../groonga.org \
            --with-ruby
      - name: Build archive
        run: |
          make dist
      - name: Update version
        run: |
          OLD_RELEASE=$(grep -E -o '[0-9.]+' packages/debian/changelog | \
                          head -n1)
          OLD_RELEASE_DATE_FULL="$(grep '^ -- ' packages/debian/changelog | \
                                     head -n1 | \
                                     sed -E -e 's/ -- .+<[^>]+>  //')"
          OLD_RELEASE_DATE=$(date --date="${OLD_RELEASE_DATE_FULL}" +%Y-%m-%d)
          make update-latest-release \
            OLD_RELEASE=${OLD_RELEASE} \
            OLD_RELEASE_DATE=${OLD_RELEASE_DATE} \
            NEW_RELEASE_DATE=$(date +%Y-%m-%d)
      - name: Cache ccache
        uses: actions/cache@v2
        with:
          path: packages/${{ matrix.task-namespace }}/build/${{ matrix.target }}/ccache
          key: package-${{ matrix.id }}-ccache-${{ hashFiles('lib/**/*.c', 'lib/**/*.cpp', 'lib/**/*.h') }}<commit_msg>ci package: don't update version on tag and maintenance branches<commit_after>name: Package
on:
  push:
    branches:
      - master
      - 'maintenance/**'
    tags:
      - '*'
  pull_request:
  schedule:
    - cron: |
        0 0 * * *
concurrency:
  group: ${{ github.head_ref || github.sha }}-${{ github.workflow }}
  cancel-in-progress: true
jobs:
  build:
    name: Build
    strategy:
      fail-fast: false
      matrix:
        label:
          - Debian GNU/Linux bullseye amd64
          - Debian GNU/Linux bullseye arm64
          - Debian GNU/Linux buster amd64
          - Debian GNU/Linux buster arm64
          - Debian GNU/Linux buster i386
          - CentOS 7
          - CentOS 8
          - AlmaLinux 8
        include:
          - label: Debian GNU/Linux bullseye amd64
            id: debian-bullseye-amd64
            task-namespace: apt
            target: debian-bullseye
            test-docker-image: debian:bullseye
          - label: Debian GNU/Linux bullseye arm64
            id: debian-bullseye-arm64
            task-namespace: apt
            target: debian-bullseye-arm64
            test-docker-image: arm64v8/debian:bullseye
          - label: Debian GNU/Linux buster amd64
            id: debian-buster-amd64
            task-namespace: apt
            target: debian-buster
            test-docker-image: debian:buster
          - label: Debian GNU/Linux buster arm64
            id: debian-buster-arm64
            task-namespace: apt
            target: debian-buster-arm64
            test-docker-image: arm64v8/debian:buster
          - label: Debian GNU/Linux buster i386
            id: debian-buster-i386
            task-namespace: apt
            target: debian-buster-i386
            test-docker-image: i386/debian:buster
          - label: CentOS 7
            id: centos-7
            task-namespace: yum
            target: centos-7
            test-docker-image: centos:7
          - label: CentOS 8
            id: centos-8
            task-namespace: yum
            target: centos-8
            test-docker-image: centos:8
          - label: AlmaLinux 8
            id: almalinux-8
            task-namespace: yum
            target: almalinux-8
            test-docker-image: almalinux:8
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: recursive
      - name: Install dependencies
        run: |
          sudo apt update
          sudo apt -V install \
            autoconf-archive \
            devscripts \
            python3-pip \
            ruby
      # qemu-user-static in Ubuntu 20.04 has the following bug.
      # https://bugs.launchpad.net/qemu/+bug/1749393
      # This bug has already fixed in Ubuntu 20.10.
      # However, this fix is not included in Ubuntu 20.04.
      # Therefore, we temporaly use qemu-user-static in Ubuntu 20.10.
      # We remove this step when qemu-user-static in Ubuntu 20.04 will include above remediation.
      - name: Install QEMU from Groovy
        run: |
          sudo tee /etc/apt/preferences.d/qemu <<EOF
          Package: *
          Pin: release n=focal
          Pin-Priority: 900
          Package: *
          Pin: release n=groovy
          Pin-Priority: 400
          EOF
          sudo tee /etc/apt/sources.list.d/groovy.list <<EOF
          deb http://jp.archive.ubuntu.com/ubuntu groovy universe
          deb http://jp.archive.ubuntu.com/ubuntu groovy-updates universe
          deb http://security.ubuntu.com/ubuntu groovy-security universe
          EOF
          sudo apt update
          sudo apt install -t groovy qemu-user-static
      - name: Install Sphinx
        run: |
          sudo pip3 install -v sphinx
      - name: Clone dependencies
        run: |
          cd ..
          git clone --depth 1 https://github.com/groonga/groonga.org.git
          git clone --depth 1 https://github.com/clear-code/cutter.git
      - name: Generate configure
        run: |
          ./autogen.sh
      - name: Configure for archive
        run: |
          ./configure \
            --enable-document \
            --enable-mruby \
            --with-cutter-source-path=../cutter \
            --with-groonga-org-path=../groonga.org \
            --with-ruby
      - name: Build archive
        run: |
          make dist
      - name: Update version
        if: |
          !startsWith(github.ref, 'refs/tags/') &&
          !startsWith(github.ref, 'refs/heads/maintenance/')
        run: |
          OLD_RELEASE=$(grep -E -o '[0-9.]+' packages/debian/changelog | \
                          head -n1)
          OLD_RELEASE_DATE_FULL="$(grep '^ -- ' packages/debian/changelog | \
                                     head -n1 | \
                                     sed -E -e 's/ -- .+<[^>]+>  //')"
          OLD_RELEASE_DATE=$(date --date="${OLD_RELEASE_DATE_FULL}" +%Y-%m-%d)
          make update-latest-release \
            OLD_RELEASE=${OLD_RELEASE} \
            OLD_RELEASE_DATE=${OLD_RELEASE_DATE} \
            NEW_RELEASE_DATE=$(date +%Y-%m-%d)
      - name: Cache ccache
        uses: actions/cache@v2
        with:
          path: packages/${{ matrix.task-namespace }}/build/${{ matrix.target }}/ccache
          key: package-${{ matrix.id }}-ccache-${{ hashFiles('lib/**/*.c', 'lib/**/*.cpp', 'lib/**/*.h') }}
{'fraction_non_alphanumeric': 0.10602432717172684, 'fraction_numerical': 0.02164543626089455, 'mean_word_length': 1.4511737089201877, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6411414', 'n_tokens_mistral': 3432, 'n_tokens_neox': 3024, 'n_words': 746}