-
Notifications
You must be signed in to change notification settings - Fork 4
APPS-24412: add GitHub iOS build workflow (without SPM support yet) #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| name: iOS framework build (manual) | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| description: "Optional. If set, update/create the GitHub Release for this tag. If empty, no release is modified." | ||
| required: false | ||
| type: string | ||
|
|
||
| env: | ||
| # There is a tie-in in "Build framework" because we need to cd into ios_framework | ||
| # If we ever change this we need to update that step as well | ||
| OUTPUT_DIR: ios_framework/artifact | ||
|
|
||
| jobs: | ||
| build-ios-framework: | ||
| runs-on: macos-14 | ||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| # Decide what "version string" to use for naming the zip. | ||
| # - manual with inputs.tag: that tag | ||
| # - manual without tag: a unique run-based value, and NO release updates | ||
| - name: Compute version/tag | ||
| id: meta | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| if [[ -n "${{ inputs.tag }}" ]]; then | ||
| ver="${{ inputs.tag }}" | ||
| do_release="true" | ||
| release_tag="${{ inputs.tag }}" | ||
| else | ||
| ver="manual-${{ github.run_number }}-${{ github.run_attempt }}" | ||
| do_release="false" | ||
| release_tag="" | ||
| fi | ||
|
|
||
| echo "ver=$ver" >> "$GITHUB_OUTPUT" | ||
| echo "zip_name=pjsip-ios-$ver.zip" >> "$GITHUB_OUTPUT" | ||
| echo "zip_path=${{ env.OUTPUT_DIR }}/pjsip-ios-$ver.zip" >> "$GITHUB_OUTPUT" | ||
| echo "do_release=$do_release" >> "$GITHUB_OUTPUT" | ||
| echo "release_tag=$release_tag" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Build framework | ||
| run: | | ||
| cd ios_framework | ||
| ./build_ios_framework.sh \ | ||
| --source-dir="${{ github.workspace }}" \ | ||
| --output-dir="$PWD/artifact" \ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here we have hidden coupling with
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct. This one might be tricky, because we are cding into the ios_framework to run the build script (like we do on TFS). We can't run in from the root otherwise it will fail because it expects some files to be in the current directory. That being said, the script can be changed to try and accommodate this, but it was not my original intention (which was to simply/mostly to mirror what was already being done).
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then, what is the reason for |
||
| --name="pjsip-ios-${{ steps.meta.outputs.ver }}" | ||
|
|
||
| - name: Upload build artifact (manual runs without tag) | ||
| if: ${{ steps.meta.outputs.do_release == 'false' }} | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ steps.meta.outputs.zip_name }} | ||
| path: ${{ steps.meta.outputs.zip_path }} | ||
| if-no-files-found: error | ||
|
|
||
| - name: Publish / update GitHub release (manual runs with tag) | ||
| if: ${{ steps.meta.outputs.do_release == 'true' }} | ||
| uses: ncipollo/release-action@v1 | ||
| with: | ||
| tag: ${{ steps.meta.outputs.release_tag }} | ||
| artifacts: ${{ steps.meta.outputs.zip_path }} | ||
| allowUpdates: true | ||
| omitNameDuringUpdate: true | ||
| replacesArtifacts: true | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you think it is better to make two separate flows: one for tag and one for manual build?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed push tags trigger and related code and renamed workflow to have "manual" suffix like we do for other ones