Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/ios-framework-release-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: iOS framework build (manual)

on:
workflow_dispatch:
Copy link
Collaborator

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?

Copy link
Collaborator Author

@CristianoCastroIntm CristianoCastroIntm Feb 18, 2026

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

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" \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we have hidden coupling with OUTPUT_DIR constant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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).
How do you like me to proceed?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then, what is the reason for OUTPUT_DIR constant? I see we can easily remove it

--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
Loading