Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • riseupvpn_experiment
  • workaround_for_go1.15
  • v0.16.0
  • v0.15.2
  • v0.15.1
  • v0.15.0
  • v0.14.1
  • v0.14.0
  • v0.13.2
  • v0.13.1
  • v0.13.0
  • v0.12.0
  • v0.11.0
  • v0.10.0
  • v0.9.0
  • v0.8.0
  • v0.7.0
  • v0.6.0
  • v0.5.0
  • v0.4.0
  • v0.3.0
  • v0.2.0
23 results

publish-ios.bash

Blame
  • publish-ios.bash 1.25 KiB
    #!/bin/bash
    set -e
    pkgname=oonimkall
    version=$(date -u +%Y.%m.%d-%H%M%S)
    baseurl=https://api.bintray.com/content/ooni/ios/$pkgname/$version
    framework=./MOBILE/ios/$pkgname.framework
    frameworkzip=./MOBILE/ios/$pkgname.framework.zip
    podspecfile=./MOBILE/ios/$pkgname.podspec
    podspectemplate=./MOBILE/template.podspec
    user=bassosimone
    (cd ./MOBILE/ios && rm -f $pkgname.framework.zip && zip -yr $pkgname.framework.zip $pkgname.framework)
    cat $podspectemplate|sed "s/@VERSION@/$version/g" > $podspecfile
    if [ -z $BINTRAY_API_KEY ]; then
        echo "FATAL: missing BINTRAY_API_KEY variable" 1>&2
        exit 1
    fi
    # We currently publish the mobile-staging branch. To cleanup we can fetch all the versions using
    # the <curl -s $user:$BINTRAY_API_KEY https://api.bintray.com/packages/ooni/android/oonimkall>
    # query, which returns a list of versions. From such list, we can delete the versions we
    # don't need using <DELETE /packages/:subject/:repo/:package/versions/:version>.
    curl -sT $frameworkzip -u $user:$BINTRAY_API_KEY $baseurl/$pkgname-$version.framework.zip?publish=1 >/dev/null
    curl -sT $podspecfile -u $user:$BINTRAY_API_KEY $baseurl/$pkgname-$version.podspec?publish=1 >/dev/null
    echo "pod 'oonimkall', :podspec => 'https://dl.bintray.com/ooni/ios/$pkgname-$version.podspec'"