feat(#891): changes in ios-demo-app #53
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: 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 --rebase | |
git push | |
git remote add abcd https://github.com/AyushiDey/tuvali_git_test.git | |
git push abcd | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |