Skip to content

Build OsmAndMaps (self hosted) #112

Build OsmAndMaps (self hosted)

Build OsmAndMaps (self hosted) #112

name: Build OsmAndMaps (self hosted)
# on:
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]
on:
workflow_dispatch:
inputs:
buildversion:
description: 'Consequent Build Number (Testflight)'
required: true
default: 'x'
releaseversion:
description: 'Release Version'
required: true
default: '4.9.0'
jobs:
build:
runs-on: self-hosted
steps:
#- uses: maxim-lobanov/setup-xcode@v1
# with:
# xcode-version: latest
# - name: Install xcode tools
# run: sudo xcode-select --install
# - name: Install brew
# run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# - name: Install svn
# run: brew install svn
# - name: Install cocoapods
# run: gem install cocoapods
### https://github.com/Kitware/CMake/releases/download/v3.11.2/cmake-3.11.2-Darwin-x86_64.dmg
# - name: Check cmake
# run: cmake --version
# - name: Check clang
# run: ls /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/
# - name: Install gpg
# run: brew install gnupg
### Checks-out repository under $GITHUB_WORKSPACE, so job can access it
- name: Checkout ios
uses: actions/checkout@v4
with:
ref: refs/heads/master
repository: osmandapp/OsmAnd-iOS
path: ios
clean: false
- name: Checkout android
uses: actions/checkout@v4
with:
ref: refs/heads/master
repository: osmandapp/OsmAnd
path: android
clean: false
- name: Checkout build
uses: actions/checkout@v4
with:
ref: refs/heads/master
repository: osmandapp/OsmAnd-build
path: build
clean: false
- name: Checkout core legacy
uses: actions/checkout@v4
with:
ref: refs/heads/master
repository: osmandapp/OsmAnd-core-legacy
path: core-legacy
clean: false
- name: Checkout core
uses: actions/checkout@v4
with:
ref: refs/heads/master
repository: osmandapp/OsmAnd-core
path: core
clean: false
- name: Checkout resources
uses: actions/checkout@v4
with:
ref: refs/heads/master
repository: osmandapp/OsmAnd-resources
path: resources
clean: false
#- name: Select XCode 15.0.1
# run: sudo xcode-select -switch /Applications/Xcode_15.0.1.app
# - name: Patch __bsfd
# run: sudo patch /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/include/ia32intrin.h ios/.github/workflows/__bsfd.patch
#- name: Setup provisioning profile
# env:
# USER_KEY: ${{ secrets.USER_KEY }}
# IOS_KEYS: ${{ secrets.IOS_KEYS }}
# PASSWORD_KEYCHAIN_EXPORT: ${{ secrets.PASSWORD_KEYCHAIN_EXPORT }}
# run: .github/secrets/install_cer.sh
# #run: .github/secrets/decrypt_secrets.sh
# working-directory: ios
- name: Setup keychain
env:
USER_KEY: ${{ secrets.USER_KEY }}
run: 'security unlock-keychain -p ${USER_KEY} ~/Library/Keychains/login.keychain-db'
- name: Build QtCore & prepare build
env:
LANG: "en_US.UTF-8"
run: exec ios/prepare.sh --sync_translations
- name: Configure iOS OsmAndCore
env:
LANG: "en_US.UTF-8"
run: 'xcodebuild -project OsmAnd_projects.xcodeproj -target ZERO_CHECK -sdk iphoneos -configuration Release'
working-directory: baked/fat-ios-clang.xcode
- name: Build iOS OsmAndCore
env:
LANG: "en_US.UTF-8"
run: 'xcodebuild -project OsmAnd_projects.xcodeproj -target OsmAndCore_static_standalone -sdk iphoneos -configuration Release'
working-directory: baked/fat-ios-clang.xcode
- name: Creating iOS archive
env:
LANG: "en_US.UTF-8"
BUILD_IOS_VERSION: ${{ github.event.inputs.buildversion }}
RELEASE_IOS_VERSION: ${{ github.event.inputs.releaseversion }}
run: 'xcodebuild
-workspace ios/OsmAnd.xcworkspace
-scheme "OsmAnd Maps Release"
-sdk iphoneos
-configuration AppStoreDistribution
-archivePath OsmAndMaps.xcarchive
CURRENT_PROJECT_VERSION="${RELEASE_IOS_VERSION}.${BUILD_IOS_VERSION}"
MARKETING_VERSION="${RELEASE_IOS_VERSION}"
archive | xcpretty'
- name: Zip iOS archive
env:
LANG: "en_US.UTF-8"
run: 'zip -r OsmAndMaps.xcarchive.zip OsmAndMaps.xcarchive'
- name: Upload maps archive zip
uses: actions/upload-artifact@v4
with:
name: OsmAndMaps-${{ github.event.inputs.releaseversion }}.${{ github.event.inputs.buildversion }}.xcarchive.zip
path: OsmAndMaps.xcarchive.zip
# - name: Download iOS archive
# run: 'wget "https://builder.osmand.net/binaries/ios/OsmAndMaps.xcarchive.zip" -O OsmAndMaps.xcarchive.zip'
# - name: Unzip iOS archive
# run: 'unzip OsmAndMaps.xcarchive.zip'
- name: Export iOS archive
env:
LANG: "en_US.UTF-8"
run: 'xcodebuild -archivePath OsmAndMaps.xcarchive
-exportOptionsPlist ios/exportOptions.plist
-exportPath .
-allowProvisioningUpdates
-exportArchive'
- name: Upload maps archive
uses: actions/upload-artifact@v4
with:
name: OsmAndMaps-${{ github.event.inputs.releaseversion }}.${{ github.event.inputs.buildversion }}.ipa
path: 'OsmAnd Maps.ipa'
- name: Publish TestFlight
env:
LANG: "en_US.UTF-8"
APPLEID_USERNAME: ${{ secrets.APPLEID_USERNAME }}
APPLEID_PASSWORD: ${{ secrets.APPLEID_PASSWORD }}
run: 'xcrun altool --upload-app -t ios -f "OsmAnd Maps.ipa" -u "$APPLEID_USERNAME" -p "$APPLEID_PASSWORD" --verbose'