<commit_before>on: [push, pull_request]
# this from  from https://github.com/sunshine-protocol/sunscreen Appache 2.0 license
#

# name is (urlencode) connected to README.md svg badge (change it there as well)
name: MacOS Build

jobs:
  build:
    name: Compile and Build - MacOS
    runs-on: macos-latest
    steps:
      # use to your like https://github.com/marketplace?type=actions
      # #################### build conditions
      - name: vtag variable
        shell: bash
        run: echo "vtag=$(echo ${GITHUB_REF#refs/tags/} | awk '/v([0-9]+\.)+[0-9]+/{print $0}')" >> $GITHUB_ENV

      - name: Extractor for vtag env
        id: extract_tag
        shell: bash
        run: echo ::set-output name=tag::${{ env.vtag }}

      - name: Release
        if: steps.extract_tag.outputs.tag != null
        shell: bash
        run: echo "Building release"
      # ############################### Installation

      # https://github.com/create-dmg/create-dmg
      - name: Install Installer Helper
        if: steps.extract_tag.outputs.tag != null
        run: brew install create-dmg

      # ##################### setup build environment
      - name: Checkout sources
        uses: actions/checkout@v2

      - name: Install Rust Toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
          components: rustfmt

      - name: Cache Cargo
        uses: actions/cache@v2
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            ~/.cargo/bin
            target/x86_64-apple-darwin
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

      - name: Install MacOS Targets
        run: rustup target add x86_64-apple-darwin

      # ############### Release/Debug build dependent
      - name: Run cargo make MacOS  - Release
        if: steps.extract_tag.outputs.tag != null
        uses: actions-rs/cargo@v1
        continue-on-error: false
        with:
          command: build
          args: --bin audiobookfinder --release --target x86_64-apple-darwin

      - name: Run cargo make MacOS  - Debug
        if: steps.extract_tag.outputs.tag == null
        uses: actions-rs/cargo@v1
        continue-on-error: false
        with:
          command: build
          args: --bin audiobookfinder --target x86_64-apple-darwin

      # #########################  compress binary

      # disable for finding macos-problem
      # https://github.com/svenstaro/upx-action
      #- name: Compress binaries
      #  if: steps.extract_tag.outputs.tag != null
      #  uses: svenstaro/upx-action@v2
      #  continue-on-error: false
      #  with:
      #    file: ./target/x86_64-apple-darwin/release/audiobookfinder
      #    args: --best
      #    strip: true

      # https://github.com/marketplace/actions/easy-zip-files
      - name: zip files
        if: steps.extract_tag.outputs.tag != null
        uses: papeloto/action-zip@v1
        continue-on-error: false
        with:
          files: >
                 ./target/x86_64-apple-darwin/release/audiobookfinder
                 ./README-release.md
                 ./LICENSE
          recursive: false
          dest: packaged

      # https://github.com/marketplace/actions/action-7z
      # not on MacOS
      #- name: 7zip Release files
      #  if: steps.extract_tag.outputs.tag != null
      #  uses: edgarrc/action-7z@v1.0.4
      #  continue-on-error: false
      #  with:
      #    args: >
      #           7z a -t7z -mx=9 packaged
      #           ./target/x86_64-apple-darwin/release/audiobookfinder
      #           ./README-release.md

      # ####################### upload intermediate result dependent if release in text or tagged

      # https://github.com/marketplace/actions/upload-files-to-a-github-release
      - name: Upload Release Asset
        if: steps.extract_tag.outputs.tag != null
        uses: svenstaro/upload-release-action@v2<commit_msg>[deployment] trying funny dmg installer<commit_after>on: [push, pull_request]
# this from  from https://github.com/sunshine-protocol/sunscreen Appache 2.0 license
#

# name is (urlencode) connected to README.md svg badge (change it there as well)
name: MacOS Build

jobs:
  build:
    name: Compile and Build - MacOS
    runs-on: macos-latest
    steps:
      # use to your like https://github.com/marketplace?type=actions
      # #################### build conditions
      - name: vtag variable
        shell: bash
        run: echo "vtag=$(echo ${GITHUB_REF#refs/tags/} | awk '/v([0-9]+\.)+[0-9]+/{print $0}')" >> $GITHUB_ENV

      - name: Extractor for vtag env
        id: extract_tag
        shell: bash
        run: echo ::set-output name=tag::${{ env.vtag }}

      - name: Release
        if: steps.extract_tag.outputs.tag != null
        shell: bash
        run: echo "Building release"
      # ############################### Installation

      # https://github.com/create-dmg/create-dmg
      - name: Install Installer Helper
        if: steps.extract_tag.outputs.tag != null
        run: brew install create-dmg

      # ##################### setup build environment
      - name: Checkout sources
        uses: actions/checkout@v2

      - name: Install Rust Toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
          components: rustfmt

      - name: Cache Cargo
        uses: actions/cache@v2
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            ~/.cargo/bin
            target/x86_64-apple-darwin
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

      - name: Install MacOS Targets
        run: rustup target add x86_64-apple-darwin

      # ############### Release/Debug build dependent
      - name: Run cargo make MacOS  - Release
        if: steps.extract_tag.outputs.tag != null
        uses: actions-rs/cargo@v1
        continue-on-error: false
        with:
          command: build
          args: --bin audiobookfinder --release --target x86_64-apple-darwin

      - name: Run cargo make MacOS  - Debug
        if: steps.extract_tag.outputs.tag == null
        uses: actions-rs/cargo@v1
        continue-on-error: false
        with:
          command: build
          args: --bin audiobookfinder --target x86_64-apple-darwin

      # #########################  compress binary

      # disable for finding macos-problem
      # https://github.com/svenstaro/upx-action
      #- name: Compress binaries
      #  if: steps.extract_tag.outputs.tag != null
      #  uses: svenstaro/upx-action@v2
      #  continue-on-error: false
      #  with:
      #    file: ./target/x86_64-apple-darwin/release/audiobookfinder
      #    args: --best
      #    strip: true

      #
      - name: Make install package
        if: steps.extract_tag.outputs.tag != null
        run: >
            create-dmg \
            --volname "Adbflib Installer" \
            --volicon "docs/sheep.icns" \
            --background "docs/installer_background.png" \
            --window-pos 200 120 \
            --window-size 800 400 \
            --icon-size 100 \
            --icon "Application.app" 200 190 \
            --hide-extension "Application.app" \
            --app-drop-link 600 185 \
            "Adbf-Installer.dmg" \
            "./target/x86_64-apple-darwin/release/audiobookfinder"

      # https://github.com/marketplace/actions/easy-zip-files
      - name: zip files
        if: steps.extract_tag.outputs.tag != null
        uses: papeloto/action-zip@v1
        continue-on-error: false
        with:
          files: >
                 ./target/x86_64-apple-darwin/release/audiobookfinder
                 ./README-release.md
                 ./LICENSE
          recursive: false
          dest: packaged

      # https://github.com/marketplace/actions/action-7z
      # not on MacOS
      #- name: 7zip Release files
      #  if: steps.extract_tag.outputs.tag != null
      #  uses: edgarrc/action-7z@v1.0.4
      #  continue-on-error: false
      #  with:
      #    args: >
      #           7z a -t7z -mx=9 packaged
      #           ./target/x86_64-apple-darwin/release/audiobookfinder
      #           ./README-release.md

      # ####################### upload intermediate result dependent if release in text or tagged

      # https://github.com/marketplace/actions/upload-files-to-a-github-release
      - name: Upload Release Asset
        if: steps.extract_tag.outputs.tag != null
        uses: svenstaro/upload-release-action@v2
{'fraction_non_alphanumeric': 0.1381151346332405, 'fraction_numerical': 0.015668523676880222, 'mean_word_length': 1.8675540765391014, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, 'https://': 14, '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': '4986044', 'n_tokens_mistral': 2709, 'n_tokens_neox': 2583, 'n_words': 588}