# :noTabs=true:mode=yaml:tabSize=2:indentSize=2:
version: 2
jobs:
  release-from-linux:
    docker:
      # important: must be same as mac bundle's python
      - image: python:3.8
    environment:
      - BUNDLE_TAG: base-5.2.2
    shell: /bin/bash --login -o pipefail
    steps:
      - checkout
      - run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y intltool unzip xsltproc zip
      - run: git clone --depth 1 --branch master https://github.com/gpodder/gpodder-osx-bundle.git
      - run: cd gpodder-osx-bundle && mkdir _build && cd _build
      - run: cd gpodder-osx-bundle/_build && wget "https://github.com/gpodder/gpodder-osx-bundle/releases/download/$BUNDLE_TAG/gPodder-$BUNDLE_TAG.deps.zip"
      - run: cd gpodder-osx-bundle/_build && wget "https://github.com/gpodder/gpodder-osx-bundle/releases/download/$BUNDLE_TAG/gPodder-$BUNDLE_TAG.deps.zip.sha256"
      - run: cd gpodder-osx-bundle/_build && sha256sum -c "gPodder-$BUNDLE_TAG.deps.zip.sha256"
      - run: cd gpodder-osx-bundle && LANG=C.UTF-8 ./release_on_linux.sh "/root/project/gpodder-osx-bundle/_build/gPodder-$BUNDLE_TAG.deps.zip" "/root/project"
      - run: rm -Rf gpodder-osx-bundle/_build/gPodder.app/ gpodder-osx-bundle/_build/*.deps.zip* gpodder-osx-bundle/_build/gPodder.contents
      - store_artifacts:
          path: /root/project/gpodder-osx-bundle/_build

workflows:
  version: 2
  build-bundle:
    jobs:
      - release-from-linux
