<commit_before>name: CPP binary SDK packaging
on:
  workflow_dispatch:
    inputs:
      commitId:
        description: 'commit ID to package'

env:
  # Packaging prerequisites
  # Binutils 2.34 released Feb 1, 2020
  binutilsVer: 2.34
  # Demumble 1.1.0 released Nov 13, 2018
  demumbleVer: 1.1.0

jobs:
  build_tools:
    name: build-packaging-tools
    runs-on: ubuntu-latest
    steps:
      - name: fetch and build binutils
        run: |
          curl -L https://ftpmirror.gnu.org/binutils/binutils-${{ env.binutilsVer }}.tar.xz --output binutils.tar.xz
          tar -xf binutils.tar.xz
          mv ./binutils-${{ env.binutilsVer }} ./binutils-src
          cd binutils-src
          ./configure --enable-targets=all --prefix=/tmp/binutils
          make
          make install
          cd -
          mkdir -p packaging-tools
          cp -af /tmp/binutils/bin/ar /tmp/binutils/bin/nm /tmp/binutils/bin/objcopy packaging-tools
      - name: fetch demumble
        uses: actions/checkout@v2.3.1
        with:
          repository: nico/demumble
          path: demumble-src
          ref: v${{ env.demumbleVer }}
      - name: build demumble
        run: |
          cd demumble-src
          cmake .
          cmake --build .
          python demumble_test.py
          cd -
          mkdir -p packaging-tools
          cp -af demumble-src/demumble packaging-tools
      - name: archive tools
        run: tar -czf packaging-tools.tgz packaging-tools
      - name: upload artifacts
        uses: actions/upload-artifact@v2
        with:
          name: packaging-tools
          path: packaging-tools.tgz

  build_ios:
    name: build-sdk-ios-${{ matrix.architecture }}
    runs-on: macos-latest
    strategy:
      matrix:
        architecture: [arm64, x86_64]
    steps:
    - name: fetch SDK
      uses: actions/checkout@v2.3.1
      with:
        path: sdk-src
        ref: ${{ github.event.inputs.commitId }}
    - name: install prerequisites
      run: sdk-src/build_scripts/ios/install_prereqs.sh
    - name: build sdk
      run: |
        sdk-src/build_scripts/ios/build.sh firebase-cpp-sdk-ios-${{ matrix.architecture }} sdk-src ${{ matrix.architecture }}
        tar -czf firebase-cpp-sdk-ios-${{ matrix.architecture }}.tgz firebase-cpp-sdk-ios-${{ matrix.architecture }}
    - name: upload artifacts
      uses: actions/upload-artifact@v2
      with:
        name: firebase-cpp-sdk-ios-${{ matrix.architecture }}
        path: firebase-cpp-sdk-ios-${{ matrix.architecture }}.tgz

  build_android:
    name: build-sdk-android
    runs-on: ubuntu-latest
    steps:
    - name: fetch SDK
      uses: actions/checkout@v2.3.1
      with:
        path: sdk-src
        ref: ${{ github.event.inputs.commitId }}
    - name: install prerequisites
      run: sdk-src/build_scripts/android/install_prereqs.sh
    - name: build sdk
      run: |
        sdk-src/build_scripts/android/build.sh firebase-cpp-sdk-android sdk-src
        tar -czf firebase-cpp-sdk-android.tgz firebase-cpp-sdk-android
    - name: upload artifacts
      uses: actions/upload-artifact@v2
      with:
        name: firebase-cpp-sdk-android
        path: firebase-cpp-sdk-android.tgz

  build_desktop:
    name: ${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [windows-latest, ubuntu-latest, macos-latest]
        build_type: ["Release", "Debug"]
        architecture: ["x64",]
        python_version: [3.7]
        include:
        - os: windows-latest
          architecture: "x64"
          vcpkg_triplet: "x64-windows-static"
          msbuild_platform: "x64"
        - os: ubuntu-latest
          architecture: "x64"
          vcpkg_triplet: "x64-linux"
        - os: macos-latest
          architecture: "x64"
          vcpkg_triplet: "x64-osx"

    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true
          ref: ${{ github.event.inputs.commitId }}

      - name: Set env variables for subsequent steps (all)
        run: |
          echo "::set-env name=VCPKG_RESPONSE_FILE::external/vcpkg_${{ matrix.vcpkg_triplet }}_response_file.txt"
          echo "::set-env name=MATRIX_UNIQUE_NAME::${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}-${{ matrix.python_version }}"

      - name: Cache vcpkg C++ dependencies
        id: cache_vcpkg
        uses: actions/cache@v2
        with:
          path: external/vcpkg/installed
          key: dev-vcpkg-${{ matrix.vcpkg_triplet }}-${{ hashFiles(format('{0}', env.VCPKG_RESPONSE_FILE)) }}-${{ hashFiles('.git/modules/external/vcpkg/HEAD') }}

      - name: Cache ccache files
        if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
        id: cache_ccache
        uses: actions/cache@v2
        with:
          path: ccache_dir
          key: dev-test-ccache-${{ env.MATRIX_UNIQUE_NAME }}

      - name: Setup python
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python_version }}
          architecture: ${{ matrix.architecture }}

      - name: Install prerequisites
        run: |
          python scripts/gha/install_prereqs_desktop.py

      - name: Build SDK
        run: |
          python scripts/gha/build_desktop.py --arch "${{ matrix.architecture }}" --config "${{ matrix.build_type }}" --build_dir "firebase-cpp-sdk-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}"

      - name: upload artifacts
        uses: actions/upload-artifact@v2
        with:
          name: "firebase-cpp-sdk-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}"
          path: "firebase-cpp-sdk-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}.tgz"
      

      - name: Stats for ccache (mac and linux)
        if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
        run: ccache -s


<commit_msg>Add tar step back in.<commit_after>name: CPP binary SDK packaging
on:
  workflow_dispatch:
    inputs:
      commitId:
        description: 'commit ID to package'

env:
  # Packaging prerequisites
  # Binutils 2.34 released Feb 1, 2020
  binutilsVer: 2.34
  # Demumble 1.1.0 released Nov 13, 2018
  demumbleVer: 1.1.0

jobs:
  build_tools:
    name: build-packaging-tools
    runs-on: ubuntu-latest
    steps:
      - name: fetch and build binutils
        run: |
          curl -L https://ftpmirror.gnu.org/binutils/binutils-${{ env.binutilsVer }}.tar.xz --output binutils.tar.xz
          tar -xf binutils.tar.xz
          mv ./binutils-${{ env.binutilsVer }} ./binutils-src
          cd binutils-src
          ./configure --enable-targets=all --prefix=/tmp/binutils
          make
          make install
          cd -
          mkdir -p packaging-tools
          cp -af /tmp/binutils/bin/ar /tmp/binutils/bin/nm /tmp/binutils/bin/objcopy packaging-tools
      - name: fetch demumble
        uses: actions/checkout@v2.3.1
        with:
          repository: nico/demumble
          path: demumble-src
          ref: v${{ env.demumbleVer }}
      - name: build demumble
        run: |
          cd demumble-src
          cmake .
          cmake --build .
          python demumble_test.py
          cd -
          mkdir -p packaging-tools
          cp -af demumble-src/demumble packaging-tools
      - name: archive tools
        run: tar -czf packaging-tools.tgz packaging-tools
      - name: upload artifacts
        uses: actions/upload-artifact@v2
        with:
          name: packaging-tools
          path: packaging-tools.tgz

  build_ios:
    name: build-sdk-ios-${{ matrix.architecture }}
    runs-on: macos-latest
    strategy:
      matrix:
        architecture: [arm64, x86_64]
    steps:
    - name: fetch SDK
      uses: actions/checkout@v2.3.1
      with:
        path: sdk-src
        ref: ${{ github.event.inputs.commitId }}
    - name: install prerequisites
      run: sdk-src/build_scripts/ios/install_prereqs.sh
    - name: build sdk
      run: |
        sdk-src/build_scripts/ios/build.sh firebase-cpp-sdk-ios-${{ matrix.architecture }} sdk-src ${{ matrix.architecture }}
        tar -czf firebase-cpp-sdk-ios-${{ matrix.architecture }}.tgz firebase-cpp-sdk-ios-${{ matrix.architecture }}
    - name: upload artifacts
      uses: actions/upload-artifact@v2
      with:
        name: firebase-cpp-sdk-ios-${{ matrix.architecture }}
        path: firebase-cpp-sdk-ios-${{ matrix.architecture }}.tgz

  build_android:
    name: build-sdk-android
    runs-on: ubuntu-latest
    steps:
    - name: fetch SDK
      uses: actions/checkout@v2.3.1
      with:
        path: sdk-src
        ref: ${{ github.event.inputs.commitId }}
    - name: install prerequisites
      run: sdk-src/build_scripts/android/install_prereqs.sh
    - name: build sdk
      run: |
        sdk-src/build_scripts/android/build.sh firebase-cpp-sdk-android sdk-src
        tar -czf firebase-cpp-sdk-android.tgz firebase-cpp-sdk-android
    - name: upload artifacts
      uses: actions/upload-artifact@v2
      with:
        name: firebase-cpp-sdk-android
        path: firebase-cpp-sdk-android.tgz

  build_desktop:
    name: ${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [windows-latest, ubuntu-latest, macos-latest]
        build_type: ["Release", "Debug"]
        architecture: ["x64",]
        python_version: [3.7]
        include:
        - os: windows-latest
          architecture: "x64"
          vcpkg_triplet: "x64-windows-static"
          msbuild_platform: "x64"
        - os: ubuntu-latest
          architecture: "x64"
          vcpkg_triplet: "x64-linux"
        - os: macos-latest
          architecture: "x64"
          vcpkg_triplet: "x64-osx"

    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true
          ref: ${{ github.event.inputs.commitId }}

      - name: Set env variables for subsequent steps (all)
        run: |
          echo "::set-env name=VCPKG_RESPONSE_FILE::external/vcpkg_${{ matrix.vcpkg_triplet }}_response_file.txt"
          echo "::set-env name=MATRIX_UNIQUE_NAME::${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}-${{ matrix.python_version }}"

      - name: Cache vcpkg C++ dependencies
        id: cache_vcpkg
        uses: actions/cache@v2
        with:
          path: external/vcpkg/installed
          key: dev-vcpkg-${{ matrix.vcpkg_triplet }}-${{ hashFiles(format('{0}', env.VCPKG_RESPONSE_FILE)) }}-${{ hashFiles('.git/modules/external/vcpkg/HEAD') }}

      - name: Cache ccache files
        if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
        id: cache_ccache
        uses: actions/cache@v2
        with:
          path: ccache_dir
          key: dev-test-ccache-${{ env.MATRIX_UNIQUE_NAME }}

      - name: Setup python
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python_version }}
          architecture: ${{ matrix.architecture }}

      - name: Install prerequisites
        run: |
          python scripts/gha/install_prereqs_desktop.py

      - name: Build SDK
        run: |
          python scripts/gha/build_desktop.py --arch "${{ matrix.architecture }}" --config "${{ matrix.build_type }}" --build_dir "firebase-cpp-sdk-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}"
	  tar -czf "firebase-cpp-sdk-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}.tgz" "firebase-cpp-sdk-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}"

      - name: upload artifacts
        uses: actions/upload-artifact@v2
        with:
          name: "firebase-cpp-sdk-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}"
          path: "firebase-cpp-sdk-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}.tgz"
      

      - name: Stats for ccache (mac and linux)
        if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
        run: ccache -s



{'fraction_non_alphanumeric': 0.1324991713622804, 'fraction_numerical': 0.010772290354656945, 'mean_word_length': 2.11941070043939, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '651342', 'n_tokens_mistral': 4109, 'n_tokens_neox': 3821, 'n_words': 811}