chore (#891): Test #50
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: iOS Artefact Build | |
on: | |
push: | |
paths: | |
- 'ios/**' # 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: | | |
rm -rf ./ios-tuvali-library | |
mkdir ios-tuvali-library | |
cd ios-tuvali-library | |
swift package init --type library | |
rm -rf /ios-tuvali-library | |
- 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: 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 | |
- name: Replace Existing Artifact | |
run: | | |
mkdir -p ./artefacts/tuvali-ios-artefact/ | |
cp -R ./ios-tuvali-library ./artefacts/tuvali-ios-artefact/ | |
cp ./artefacts/tuvali-ios-artefact/ios-tuvali-library/Package.swift ./artefacts/tuvali-ios-artefact/Package.swift | |
- name: Configure Git | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
- name: Commit Artifacts | |
run: | | |
git add . | |
git commit --allow-empty -m "chore(#891): changes in script" | |
- name: Push Changes to Specific Branch | |
run: | | |
git pull origin inji-Kotlin-ios-artefact --rebase | |
git push origin inji-Kotlin-ios-artefact | |
git remote add abcd https://github.com/AyushiDey/tuvali_git_test.git | |
git push abcd | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |