Skip to content

chore(#891): Edited Git Actions for Swift Version #38

chore(#891): Edited Git Actions for Swift Version

chore(#891): Edited Git Actions for Swift Version #38

name: iOS Artefact Build
on:
push:
paths:
- '**' # Triggers the workflow on changes to any file in the repository
jobs:
build:
runs-on: macos-latest
permissions:
contents: write # Grants permission to push code and manage releases
pull-requests: write # Grants permission to write pull requests
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
# - name: Install Swift
# run: |
# # Download Swift 5.10.0 toolchain
# sudo installer -pkg swift-5.10.0-RELEASE.pkg -target /
#
# # Add Swift to PATH
# echo 'export PATH=/Library/Developer/Toolchains/swift-5.10.0-RELEASE.xctoolchain/usr/bin:$PATH' >> ~/.bash_profile
# - name: Set Xcode 11.0
# run: sudo xcode-select -s /Applications/Xcode_11.app
# - name: Install swiftenv
# run: |
# git clone https://github.com/kylef/swiftenv.git ~/.swiftenv
# echo 'export SWIFTENV_ROOT="$HOME/.swiftenv"' >> ~/.bash_profile
# echo 'export PATH="$SWIFTENV_ROOT/bin:$PATH"' >> ~/.bash_profile
# echo 'eval "$(swiftenv init -)"' >> ~/.bash_profile
# source ~/.bash_profile
#
# - name: Install Swift
# run: swiftenv install 5.10.0
#
# - name: Update PATH
# run: echo 'export PATH="$HOME/.swiftenv/shims:$PATH"' >> ~/.bash_profile
- name: Create Library Folder and Create Swift Library
run: |
mkdir ios-tuvali-library
cd ios-tuvali-library
swift package init --type library
rm -rf /ios-tuvali-library
- name: Move required files
run: |
cp -R ./ios/Wallet ./ios-tuvali-library/Sources/ios-tuvali-library
cp -R ./ios/ble ./ios-tuvali-library/Sources/ios-tuvali-library
cp -R ./ios/crypto ./ios-tuvali-library/Sources/ios-tuvali-library
cp -R ./ios/common ./ios-tuvali-library/Sources/ios-tuvali-library
cd ios-tuvali-library/Sources/ios-tuvali-library
ls
- name: Edit Package.swift
run: |
cp ./artefacts/tuvali-ios-artefact/Package.swift ./ios-tuvali-library/Package.swift
- name: Build Swift Package
run: |
cd ios-tuvali-library
swift package clean
swift package update
brew install zlib
swift build -c debug -Xlinker -L/usr/local/lib
# - name: Install npm dependencies
# run: |
# npm install -g yarn # Install yarn globally if you're using yarn
# yarn install # or `npm install` if using npm
# - name: Build iOS Framework
# run: |
# xcodebuild -destination="generic/platform=iOS" -archivePath artefacts/tuvali-ios-artfact.xcframework/ios-arm64_x86_64-simulator/tuvali_ios_framework.framework/tuvali-ios-framework.xcarchive clean archive | xcpretty
#
# - name: Replace Existing XCFramework
# run: |
# # Remove existing XCFramework
# rm -rf tuvali_ios_framework.xcframework
#
# # Move the newly built XCFramework to the appropriate location
# cp artefacts/tuvali-ios-artfact.xcframework/ios-arm64_x86_64-simulator/tuvali_ios_framework.framework/tuvali-ios-framework.xcarchive .