Bump td from c85b20a
to 437e7f9
#579
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
# Controls when the workflow will run | |
on: | |
push: | |
branches: [main] | |
paths: | |
- "td" # on TDLib updates | |
- ".github/workflows/**" # on CI updates | |
pull_request: | |
branches: [main] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
env: | |
TDLIB_REPO: https://github.com/tdlib/td | |
ARTIFACT_NAME: TDLibFramework.zip | |
ARTIFACT_DIR: ./builder/build | |
DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer | |
jobs: | |
build: | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [iOS, iOS-simulator, macOS, watchOS, watchOS-simulator, tvOS, tvOS-simulator, visionOS, visionOS-simulator] | |
uses: ./.github/workflows/build.yml | |
with: | |
platform: ${{ matrix.platform }} | |
developer-dir: "/Applications/Xcode_15.2.app/Contents/Developer" | |
# Merge frameworks | |
merge-xcframework: | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
runs-on: macos-14 | |
needs: [build] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: ./.github/actions/download-and-unpack-xcarchive | |
with: | |
platform: iOS | |
- uses: ./.github/actions/download-and-unpack-xcarchive | |
with: | |
platform: iOS-simulator | |
- uses: ./.github/actions/download-and-unpack-xcarchive | |
with: | |
platform: macOS | |
- uses: ./.github/actions/download-and-unpack-xcarchive | |
with: | |
platform: watchOS | |
- uses: ./.github/actions/download-and-unpack-xcarchive | |
with: | |
platform: watchOS-simulator | |
- uses: ./.github/actions/download-and-unpack-xcarchive | |
with: | |
platform: tvOS | |
- uses: ./.github/actions/download-and-unpack-xcarchive | |
with: | |
platform: tvOS-simulator | |
- uses: ./.github/actions/download-and-unpack-xcarchive | |
with: | |
platform: visionOS | |
- uses: ./.github/actions/download-and-unpack-xcarchive | |
with: | |
platform: visionOS-simulator | |
- name: Merge Frameworks | |
working-directory: ./builder | |
run: ./merge-frameworks.sh "iOS iOS-simulator macOS watchOS watchOS-simulator tvOS tvOS-simulator visionOS visionOS-simulator" | |
- name: Archive XCFramework | |
working-directory: ./builder/build | |
run: zip --symlinks -r TDLibFramework.zip TDLibFramework.xcframework | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: TDLibFramework.zip | |
path: ./builder/build/TDLibFramework.zip | |
if-no-files-found: error | |
# Tests | |
tests: | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
runs-on: macos-14 | |
needs: [merge-xcframework] | |
strategy: | |
matrix: | |
include: | |
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md#installed-sdks | |
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md#installed-simulators | |
- platform: "macOS" | |
- platform: "iOS-simulator" | |
os_list: "17.2" | |
device_name: "iPhone 15" | |
- platform: "tvOS-simulator" | |
os_list: "17.2" | |
device_name: "Apple TV 4K (3rd generation) (at 1080p)" | |
- platform: "watchOS-simulator" | |
os_list: "10.2" | |
device_name: "Apple Watch Series 9 (45mm)" | |
- platform: "visionOS-simulator" | |
os_list: "1.0" | |
device_name: "Apple Vision Pro" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download XCFramework | |
uses: actions/download-artifact@v4 | |
with: | |
name: TDLibFramework.zip | |
path: ${{ env.ARTIFACT_DIR }} | |
- name: Unpack framework | |
working-directory: ${{ env.ARTIFACT_DIR }} | |
run: unzip ${{ env.ARTIFACT_NAME }} | |
# https://github.com/actions/runner-images/issues/10692 | |
- uses: ./.github/actions/install-visionos-runtime | |
if: ${{ matrix.platform == 'visionOS' || matrix.platform == 'visionOS-simulator' }} | |
with: | |
developer_dir: ${{ env.DEVELOPER_DIR }} | |
- name: Update Package.swift with local .xcframework | |
run: python3 scripts/swift_package_generator.py --path ${{ env.ARTIFACT_DIR }}/TDLibFramework.xcframework | |
- name: Run Tests for ${{ matrix.platform }} | |
run: ./scripts/test.sh ${{ matrix.platform }} "${{ matrix.os_list }}" "${{ matrix.device_name }}" || ./scripts/test.sh ${{ matrix.platform }} "${{ matrix.os_list }}" "${{ matrix.device_name }}" | |
create-release: | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
runs-on: macos-14 | |
needs: [tests] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set Envs | |
run: | | |
ARTIFACT_PATH="./builder/build/${{ env.ARTIFACT_NAME }}" | |
echo "ARTIFACT_PATH=$ARTIFACT_PATH" >> $GITHUB_ENV | |
RELEASES_DOWNLOAD_URL=https://github.com/$GITHUB_REPOSITORY/releases/download | |
echo "RELEASES_DOWNLOAD_URL=$RELEASES_DOWNLOAD_URL" >> $GITHUB_ENV | |
TDLIB_COMMIT=$(cd td && git rev-parse --short=8 HEAD) | |
echo "TDLIB_COMMIT=$TDLIB_COMMIT" >> $GITHUB_ENV | |
TDLIB_VERSION=$(python3 scripts/extract_td_version.py td/CMakeLists.txt) | |
echo "TDLIB_VERSION=$TDLIB_VERSION" >> $GITHUB_ENV | |
TDLIB_COMMIT_URL=${{ env.TDLIB_REPO }}/tree/$TDLIB_COMMIT | |
echo "TDLIB_COMMIT_URL=$TDLIB_COMMIT_URL" >> $GITHUB_ENV | |
RELEASE_TAG=$TDLIB_VERSION-$TDLIB_COMMIT | |
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV | |
- name: Download XCFramework | |
uses: actions/download-artifact@v4 | |
with: | |
name: TDLibFramework.zip | |
path: ${{ env.ARTIFACT_DIR }} | |
- name: Get Checksum | |
run: | | |
ARTIFACT_CHECKSUM=$(swift package compute-checksum ${{ env.ARTIFACT_PATH }}) | |
echo "ARTIFACT_CHECKSUM=$ARTIFACT_CHECKSUM" >> $GITHUB_ENV | |
- name: Update Package.swift | |
if: github.ref == 'refs/heads/main' | |
run: | | |
python3 scripts/swift_package_generator.py --url "${{ env.RELEASES_DOWNLOAD_URL }}/${{ env.RELEASE_TAG }}/${{ env.ARTIFACT_NAME }}" --checksum ${{ env.ARTIFACT_CHECKSUM }} | |
git add Package.swift || true | |
git commit -m "[no ci] Bump TDLib ${{ env.RELEASE_TAG }}" || true | |
git push origin main || true | |
- name: Remove previous release | |
if: github.ref == 'refs/heads/main' | |
run: gh release delete ${{ env.RELEASE_TAG }} --cleanup-tag || true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Release | |
if: github.ref == 'refs/heads/main' | |
run: | | |
echo -e "XCFramework based on TDLib-${{ env.TDLIB_VERSION }} commit [${{ env.TDLIB_COMMIT }}](${{ env.TDLIB_COMMIT_URL }})\n\nZIP Checksum \`${{ env.ARTIFACT_CHECKSUM }}\`" > release.md | |
gh release create ${{ env.RELEASE_TAG }} ${{ env.ARTIFACT_PATH }} --target main --notes-file release.md | |
rm release.md | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |