Skip to content

Commit 0223410

Browse files
committed
Update GitHub workflows
1 parent 19b7b29 commit 0223410

21 files changed

+1823
-22
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# This workflow builds and tests the project.
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift
1+
# This workflow builds the project for all platforms.
2+
3+
# For more information see:
4+
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift
35

46
name: Build Runner
57

@@ -9,15 +11,22 @@ on:
911
pull_request:
1012
branches: ["main"]
1113

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
16+
cancel-in-progress: true
17+
1218
jobs:
1319
build:
14-
runs-on: macos-15
20+
runs-on: macos-latest # macos-15
21+
1522
steps:
16-
- uses: actions/checkout@v3
17-
- uses: maxim-lobanov/setup-xcode@v1
23+
- name: Checkout Code
24+
uses: actions/checkout@v5
25+
26+
- name: Setup Xcode
27+
uses: maxim-lobanov/setup-xcode@v1
1828
with:
19-
xcode-version: latest-stable
20-
- name: Build all platforms
21-
run: bash scripts/build.sh ${{ github.event.repository.name }}
22-
- name: Test iOS
23-
run: bash scripts/test.sh ${{ github.event.repository.name }}
29+
xcode-version: latest-stable # 16.4
30+
31+
- name: Build All Platforms
32+
run: bash scripts/build.sh

.github/workflows/docc.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# This workflow builds publish DocC docs to GitHub Pages.
1+
# This workflow builds and publishes DocC docs to GitHub Pages.
2+
23
# Source: https://maxxfrazer.medium.com/deploying-docc-with-github-actions-218c5ca6cad5
34
# Sample: https://github.com/AgoraIO-Community/VideoUIKit-iOS/blob/main/.github/workflows/deploy_docs.yml
45

@@ -21,26 +22,31 @@ concurrency:
2122

2223
jobs:
2324
deploy:
25+
runs-on: macos-latest # macos-15
26+
2427
environment:
2528
name: github-pages
2629
url: ${{ steps.deployment.outputs.page_url }}
27-
runs-on: macos-15
30+
2831
steps:
29-
- name: Checkout
30-
uses: actions/checkout@v3
31-
- id: pages
32-
name: Setup Pages
32+
- name: Checkout Code
33+
uses: actions/checkout@v5
34+
35+
- name: Configure Pages
3336
uses: actions/configure-pages@v4
34-
- name: Select Xcode version
37+
38+
- name: Setup Xcode
3539
uses: maxim-lobanov/setup-xcode@v1
3640
with:
37-
xcode-version: latest-stable
41+
xcode-version: latest-stable # 16.4
42+
3843
- name: Build DocC
39-
run: bash scripts/docc.sh ${{ github.event.repository.name }}
40-
- name: Upload artifact
44+
run: bash scripts/docc.sh
45+
46+
- name: Upload DocC Artifact
4147
uses: actions/upload-pages-artifact@v3
4248
with:
4349
path: '.build/docs-iOS'
44-
- id: deployment
45-
name: Deploy to GitHub Pages
50+
51+
- name: Deploy to GitHub Pages
4652
uses: actions/deploy-pages@v4

.github/workflows/test.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This workflow tests the project on all platforms.
2+
3+
# For more information see:
4+
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift
5+
6+
name: Test Runner
7+
8+
on:
9+
push:
10+
branches: ["main"]
11+
pull_request:
12+
branches: ["main"]
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
build:
20+
runs-on: macos-latest # macos-15
21+
22+
steps:
23+
- name: Checkout Code
24+
uses: actions/checkout@v5
25+
26+
- name: Setup Xcode
27+
uses: maxim-lobanov/setup-xcode@v1
28+
with:
29+
xcode-version: latest-stable # 16.4
30+
31+
- name: Tests All Platforms
32+
run: bash scripts/test.sh

.github/workflows/version-bump.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# This workflow bumps the repository version.
2+
# You can bump it a major, minor, or patch step, or use a custom version.
3+
4+
# For this to work, you must define these repository secrets:
5+
# - BUILD_CERTIFICATE_BASE64
6+
# - P12_PASSWORD
7+
# - KEYCHAIN_PASSWORD
8+
9+
# OBS! You must also change FRAMEWORK_NAME below to use your
10+
# framework's name.
11+
12+
# For more information see:
13+
# https://danielsaidi.com/blog/2025/11/09/building-closed-source-binaries-with-github-actions
14+
15+
name: Bump Version
16+
17+
on:
18+
workflow_dispatch:
19+
inputs:
20+
bump_type:
21+
description: 'Version bump'
22+
required: true
23+
type: choice
24+
options:
25+
- patch
26+
- minor
27+
- major
28+
- custom
29+
custom_version:
30+
description: 'Custom version (for "custom")'
31+
required: false
32+
type: string
33+
34+
permissions:
35+
contents: write
36+
37+
concurrency:
38+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
39+
cancel-in-progress: true
40+
41+
jobs:
42+
bump:
43+
runs-on: ubuntu-latest
44+
45+
steps:
46+
- name: Checkout
47+
uses: actions/checkout@v4
48+
with:
49+
fetch-depth: 0 # Fetch all history and tags
50+
51+
- name: Configure Git
52+
run: |
53+
git config user.name "github-actions[bot]"
54+
git config user.email "github-actions[bot]@users.noreply.github.com"
55+
56+
- name: Bump Version
57+
run: |
58+
if [ "${{ inputs.bump_type }}" = "custom" ]; then
59+
if [ -z "${{ inputs.custom_version }}" ]; then
60+
echo "Error: Custom version not provided"
61+
exit 1
62+
fi
63+
./scripts/version-bump.sh --version "${{ inputs.custom_version }}"
64+
else
65+
./scripts/version-bump.sh --type "${{ inputs.bump_type }}"
66+
fi

.github/workflows/xcframework.yml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# This workflow builds binaries for a closed-source package.
2+
# The output is an XCFramework container(!) zip a dSYMs zip.
3+
4+
# For this to work you must define these repository secrets:
5+
# - BUILD_CERTIFICATE_BASE64
6+
# - P12_PASSWORD
7+
# - KEYCHAIN_PASSWORD
8+
9+
# VERY IMPORTANT!
10+
# The XCFramework zip is a CONTAINER with the actual zip inside!
11+
# You must download and unzip it, then upload the nested zip to a release.
12+
# Uploading the container zip file will make Xcode fail to use the release.
13+
14+
# For more information see:
15+
# https://danielsaidi.com/blog/2025/11/09/building-closed-source-binaries-with-github-actions
16+
17+
name: Create Binary Artifacts
18+
19+
on:
20+
workflow_dispatch:
21+
inputs:
22+
bump_type:
23+
description: 'Version bump'
24+
required: false
25+
type: choice
26+
options:
27+
- none
28+
- patch
29+
- minor
30+
- major
31+
- custom
32+
default: none
33+
custom_version:
34+
description: 'Custom version (for "custom")'
35+
required: false
36+
type: string
37+
38+
permissions:
39+
contents: write
40+
41+
concurrency:
42+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
43+
cancel-in-progress: true
44+
45+
jobs:
46+
build:
47+
runs-on: macos-latest # macos-15
48+
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v4
52+
with:
53+
fetch-depth: 0 # Fetch all history and tags (needed for version bumping)
54+
55+
- name: Get Package Name
56+
run: |
57+
PACKAGE_NAME=$(./scripts/package-name.sh)
58+
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV
59+
60+
- name: Install build certificate
61+
env:
62+
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
63+
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
64+
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
65+
run: |
66+
# create variables
67+
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
68+
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
69+
70+
# import certificate from secrets
71+
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
72+
73+
# create temporary keychain
74+
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
75+
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
76+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
77+
78+
# import certificate to keychain
79+
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
80+
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
81+
security list-keychain -d user -s $KEYCHAIN_PATH
82+
83+
- name: Set up Xcode
84+
uses: maxim-lobanov/setup-xcode@v1
85+
with:
86+
xcode-version: latest-stable # 16.4
87+
88+
- name: Validate git
89+
run: ./scripts/release-validate-git.sh
90+
91+
- name: Validate project
92+
run: ./scripts/release-validate-package.sh -p iOS --swiftlint 0
93+
94+
- name: Run framwork script
95+
run: ./scripts/framework.sh -p iOS --dsyms 1 --zip 1
96+
97+
- name: Upload XCFramework Container
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: ${{ env.PACKAGE_NAME }}-Container
101+
path: .build/${{ env.PACKAGE_NAME }}.zip
102+
if-no-files-found: error
103+
104+
- name: Upload dSYMs
105+
uses: actions/upload-artifact@v4
106+
with:
107+
name: ${{ env.PACKAGE_NAME }}-dSYMs
108+
path: .build/dSYMs
109+
if-no-files-found: error
110+
111+
- name: Configure Git
112+
if: ${{ inputs.bump_type != 'none' }}
113+
run: |
114+
git config user.name "github-actions[bot]"
115+
git config user.email "github-actions[bot]@users.noreply.github.com"
116+
117+
- name: Bump Version
118+
if: ${{ inputs.bump_type != 'none' }}
119+
run: |
120+
if [ "${{ inputs.bump_type }}" = "custom" ]; then
121+
if [ -z "${{ inputs.custom_version }}" ]; then
122+
echo "Error: Custom version not provided"
123+
exit 1
124+
fi
125+
./scripts/version-bump.sh --version "${{ inputs.custom_version }}"
126+
else
127+
./scripts/version-bump.sh --type "${{ inputs.bump_type }}"
128+
fi

0 commit comments

Comments
 (0)