|
8 | 8 | default: false
|
9 | 9 | required: true
|
10 | 10 | type: boolean
|
| 11 | + android: |
| 12 | + description: Publish an android version (maven) |
| 13 | + default: true |
| 14 | + required: true |
| 15 | + type: boolean |
11 | 16 | rust:
|
12 | 17 | description: Publish a rust version (crates.io)
|
13 | 18 | default: true
|
14 | 19 | required: true
|
15 | 20 | type: boolean
|
16 |
| - android: |
17 |
| - description: Publish an android version (maven) |
| 21 | + swift: |
| 22 | + description: Publish a swift version (cocoapods) |
18 | 23 | default: true
|
19 | 24 | required: true
|
20 | 25 | type: boolean
|
@@ -109,15 +114,13 @@ jobs:
|
109 | 114 | rustup target add x86_64-unknown-linux-gnu
|
110 | 115 |
|
111 | 116 | - name: Build
|
112 |
| - run: | |
113 |
| - cd wrappers/android |
114 |
| - sh build.sh |
| 117 | + run: sh wrappers/android/build.sh |
115 | 118 |
|
116 | 119 | - name: Create local.properties
|
117 |
| - run: | |
118 |
| - echo "sdk.dir=$ANDROID_HOME" > local.properties |
| 120 | + run: echo "sdk.dir=$ANDROID_HOME" > local.properties |
119 | 121 |
|
120 |
| - - run: chmod +x gradlew |
| 122 | + - name: Allow gradlew to run |
| 123 | + run: chmod +x gradlew |
121 | 124 |
|
122 | 125 | - name: Package .aar
|
123 | 126 | run: ./gradlew clean assembleRelease
|
@@ -148,3 +151,49 @@ jobs:
|
148 | 151 | run: cargo publish
|
149 | 152 | env:
|
150 | 153 | CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
| 154 | + |
| 155 | + build-swift: |
| 156 | + environment: cocoapods-publish |
| 157 | + if: ${{ inputs.swift }} |
| 158 | + runs-on: macos-latest |
| 159 | + |
| 160 | + steps: |
| 161 | + - name: Checkout repo |
| 162 | + uses: actions/checkout@v4 |
| 163 | + |
| 164 | + - name: Setup rust |
| 165 | + run: | |
| 166 | + rustup target add aarch64-apple-ios |
| 167 | + rustup target add x86_64-apple-ios |
| 168 | + cargo install cargo-lipo |
| 169 | +
|
| 170 | + - name: Build iOS libraries |
| 171 | + run: sh wrappers/swift/build.sh |
| 172 | + |
| 173 | + # - name: Setup version |
| 174 | + # id: version |
| 175 | + # run: | |
| 176 | + # VERSION=$(grep -E "^\s*s\.version\s*=\s*['\"][0-9]+\.[0-9]+\.[0-9]+['\"]" Slauth.podspec | awk -F"[\"\']" '{print $2}') |
| 177 | + # echo "branch_name=release/cocoapods-v$VERSION" >> $GITHUB_OUTPUT |
| 178 | + |
| 179 | + # - name: Push to a new branch |
| 180 | + # run: | |
| 181 | + # git checkout --orphan ${{ steps.version.outputs.branch_name }} |
| 182 | + # git rm -rf . |
| 183 | + # git checkout devops/cloudsmith-cocoapods -- LICENSE wrappers/swift/classes slauth.h Slauth.podspec |
| 184 | + # git add LICENSE wrappers/swift/classes/** slauth.h Slauth.podspec target/universal/release/* target/x86_64-apple-ios/release/* target/aarch64-apple-ios/release/* |
| 185 | + # git commit -m "Set up CocoaPods release branch" |
| 186 | + # git push origin ${{ steps.version.outputs.branch_name }} |
| 187 | + # env: |
| 188 | + # GITHUB_TOKEN: ${{ github.token }} |
| 189 | + |
| 190 | + # - name: Update Podspec |
| 191 | + # run: sed -i '' "s|:branch => '.*'|:branch => '${{ steps.version.outputs.branch_name }}'|" Slauth.podspec |
| 192 | + |
| 193 | + - name: Validate podspec |
| 194 | + run: pod spec lint --skip-import-validation --use-libraries --allow-warnings |
| 195 | + |
| 196 | + - name: Publish to CocoaPods |
| 197 | + run: pod trunk push Slauth.podspec --skip-import-validation --use-libraries --allow-warnings |
| 198 | + env: |
| 199 | + COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} |
0 commit comments