refactor: enable automatic iOS builds (#209)

* refactor: enable automatic iOS builds

Part of https://github.com/ooni/probe/issues/1335

* fix: go mod tidy
This commit is contained in:
Simone Basso
2021-02-03 13:51:15 +01:00
committed by GitHub
parent b4c311cb45
commit c824612812
4 changed files with 8 additions and 8 deletions
-18
View File
@@ -1,18 +0,0 @@
name: ios
on:
push:
branches:
- mobile-staging
- 'release/**'
jobs:
test:
runs-on: macos-latest
steps:
- uses: actions/setup-go@v1
with:
go-version: "1.14"
- uses: actions/checkout@v2
- run: ./build-ios.bash
- run: ./publish-ios.bash
env:
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
-11
View File
@@ -1,11 +0,0 @@
#!/bin/bash
set -e
topdir=$(cd $(dirname $0) && pwd -P)
set -x
export PATH=$(go env GOPATH)/bin:$PATH
export GO111MODULE=off
go get -u golang.org/x/mobile/cmd/gomobile
gomobile init
export GO111MODULE=on
output=MOBILE/ios/oonimkall.framework
gomobile bind -target=ios -o $output -ldflags="-s -w" ./oonimkall
-23
View File
@@ -1,23 +0,0 @@
#!/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'"