Create and Publish Swift Package #10
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: Create and Publish Swift Package | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: 🔨 Build | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Build iOS framework | |
id: buildPackage | |
run: ./gradlew :daraja:createSwiftPackage --stacktrace | |
- name: Upload Swift Package directory | |
uses: actions/upload-artifact@v3 | |
with: | |
name: swiftpackage | |
path: daraja/swiftpackage | |
retention-days: 1 | |
push: | |
name: 📤 Push to Swift Repo | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download directory with swift package | |
uses: actions/download-artifact@v3 | |
with: | |
name: swiftpackage | |
path: swiftpackage | |
- name: Display structure of downloaded files | |
run: ls -R | |
- name: Push directory to another repository | |
uses: cpina/github-action-push-to-another-repository@main | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} | |
with: | |
source-directory: 'swiftpackage' | |
destination-github-username: 'VictorKabata' | |
destination-repository-name: 'DarajaSwiftPackage' | |
create-target-branch-if-needed: true |