<commit_before>#! /bin/bash

set -o errexit
set -o nounset

build_appimage(){
  package_version=$1

  mkdir pony-stable.AppDir

  cat > ./pony-stable.desktop <<\EOF
[Desktop Entry]
Name=Pony Dependency Manager
Icon=pony-stable
Type=Application
NoDisplay=true
Exec=stable
Terminal=true
Categories=Development;
EOF

  curl https://www.ponylang.io/images/logo.png -o pony-stable.png

  curl https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -o linuxdeploy-x86_64.AppImage -J -L
  chmod +x linuxdeploy-x86_64.AppImage

  # remove any existing build artifacts
  sudo rm -rf build

  # can't run appimages in docker; need to extract and then run
  sudo docker run -v "$(pwd):/home/pony" --rm -u pony:2000 ponylang/ponyc-ci:centos7-llvm-3.9.1 sh -c "./linuxdeploy-x86_64.AppImage --appimage-extract"

  # need to run in CentOS 7 docker image
  sudo docker run -v "$(pwd):/home/pony" --rm --user root ponylang/ponyc-ci:centos7-llvm-3.9.1 sh -c "yum install yum-plugin-copr -y && yum copr enable ponylang/ponylang epel-7 -y && yum install ponyc -y && make arch=x86-64 DESTDIR=pony-stable.AppDir prefix=/usr test integration"
  sudo docker run -v "$(pwd):/home/pony" --rm -u pony:2000 ponylang/ponyc-ci:centos7-llvm-3.9.1 sh -c "make arch=x86-64 DESTDIR=pony-stable.AppDir prefix=/usr install"
  sudo docker run -v "$(pwd):/home/pony" --rm -u pony:2000 ponylang/ponyc-ci:centos7-llvm-3.9.1 sh -c "ARCH=x86_64 ./squashfs-root/AppRun --appdir pony-stable.AppDir --desktop-file=pony-stable.desktop --icon-file=pony-stable.png --app-name=pony-stable --output appimage"

  mv Pony_Dependency_Manager-x86_64.AppImage "Pony_Depencency_Manager-${package_version}-x86_64.AppImage"

  bash .bintray.bash appimage "${package_version}" pony-stable
}

build_deb(){
  deb_distro=$1

  # untar source code
  tar -xvzf "pony-stable_${package_version}.orig.tar.gz"

  pushd pony-stable-*<commit_msg>Fix appimage build by removing deprecated argument<commit_after>#! /bin/bash

set -o errexit
set -o nounset

build_appimage(){
  package_version=$1

  mkdir pony-stable.AppDir

  cat > ./pony-stable.desktop <<\EOF
[Desktop Entry]
Name=Pony Dependency Manager
Icon=pony-stable
Type=Application
NoDisplay=true
Exec=stable
Terminal=true
Categories=Development;
EOF

  curl https://www.ponylang.io/images/logo.png -o pony-stable.png

  curl https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -o linuxdeploy-x86_64.AppImage -J -L
  chmod +x linuxdeploy-x86_64.AppImage

  # remove any existing build artifacts
  sudo rm -rf build

  # can't run appimages in docker; need to extract and then run
  sudo docker run -v "$(pwd):/home/pony" --rm -u pony:2000 ponylang/ponyc-ci:centos7-llvm-3.9.1 sh -c "./linuxdeploy-x86_64.AppImage --appimage-extract"

  # need to run in CentOS 7 docker image
  sudo docker run -v "$(pwd):/home/pony" --rm --user root ponylang/ponyc-ci:centos7-llvm-3.9.1 sh -c "yum install yum-plugin-copr -y && yum copr enable ponylang/ponylang epel-7 -y && yum install ponyc -y && make arch=x86-64 DESTDIR=pony-stable.AppDir prefix=/usr test integration"
  sudo docker run -v "$(pwd):/home/pony" --rm -u pony:2000 ponylang/ponyc-ci:centos7-llvm-3.9.1 sh -c "make arch=x86-64 DESTDIR=pony-stable.AppDir prefix=/usr install"
  sudo docker run -v "$(pwd):/home/pony" --rm -u pony:2000 ponylang/ponyc-ci:centos7-llvm-3.9.1 sh -c "ARCH=x86_64 ./squashfs-root/AppRun --appdir pony-stable.AppDir --desktop-file=pony-stable.desktop --icon-file=pony-stable.png --output appimage"

  mv Pony_Dependency_Manager-x86_64.AppImage "Pony_Depencency_Manager-${package_version}-x86_64.AppImage"

  bash .bintray.bash appimage "${package_version}" pony-stable
}

build_deb(){
  deb_distro=$1

  # untar source code
  tar -xvzf "pony-stable_${package_version}.orig.tar.gz"

  pushd pony-stable-*
{'fraction_non_alphanumeric': 0.13556246759979265, 'fraction_numerical': 0.0352514256091239, 'mean_word_length': 4.024739583333333, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '68478', 'n_tokens_mistral': 1610, 'n_tokens_neox': 1426, 'n_words': 336}