Skip to content

Create and Publish Swift Package #1

Create and Publish Swift Package

Create and Publish Swift Package #1

name: Create and Publish Swift Package
on:
workflow_dispatch:
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'
- name: Build iOS framework
id: buildPackage
run: ./gradlew createSwiftPackage
- name: Upload Swift Package directory
uses: actions/upload-artifact@v3
with:
name: swiftpackage
path: daraja/swiftpackage
retention-days: 1
push:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- 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
target-branch: ${{ github.event.inputs.iOSBranchName }}