Skip to content

Add visionOS in the create-xcframeworks script #5

Add visionOS in the create-xcframeworks script

Add visionOS in the create-xcframeworks script #5

Workflow file for this run

name: Create Release
on:
push:
branches:
- "release/*"
env:
DEVELOPER_DIR: "/Applications/Xcode_15.2.app/Contents/Developer"
# FYI diff between author and committer: <https://stackoverflow.com/a/18754896>.
# For commits
GIT_AUTHOR_EMAIL: "[email protected]"
GIT_AUTHOR_NAME: "GitHub Runner (eXtenderZ)"
# For tags
GIT_COMMITTER_EMAIL: "[email protected]"
GIT_COMMITTER_NAME: "GitHub Runner (eXtenderZ)"
jobs:
bump-version-compile-and-tag:
name: "Bump Build Version, Build and Tag"
runs-on: ["macos-14"]
steps:
- name: "Import GPG Signing Key"
run: gpg --import --pinentry-mode=loopback --passphrase "${{ secrets.GPG_PRIVATE_KEY_PASS }}" <<<'${{ secrets.GPG_PRIVATE_KEY }}'
- name: "Install xct and swift-sh"
run: |
brew install xcode-actions/tap/xct xcode-actions/tap/swift-sh
- name: "Checkout eXtenderZ versioning"
uses: actions/checkout@v2
with:
ref: "versioning"
- name: "Bump Build Version in versioning Branch"
run: |
set -euo pipefail
BUILD_VERSION_FILE=eXtenderZ_version.txt
echo $(($(cat "$BUILD_VERSION_FILE") + 1)) >"$BUILD_VERSION_FILE"
git commit "$BUILD_VERSION_FILE" -m "Bump build version"
# Note:
# This might fail if someone pushed a version from another branch.
# We do not auto-retry for now because this is very unlikely to happen for this repository.
git push
cp -f "$BUILD_VERSION_FILE" ../new_build_version
- name: "Checkout eXtenderZ"
uses: actions/checkout@v2
- name: "Set Build Versions, Build xcframeworks and Push Tag"
run: |
set -euo pipefail
NEW_MARKETING_VERSION="$(basename "$GITHUB_REF")"
test -n "$NEW_MARKETING_VERSION"
NEW_BUILD_VERSION="$(cat ../new_build_version)"
rm -f ../new_build_version
eval xct versions set-build-version --targets\ eXtenderZ-{static,dynamic}-{macOS,visionOS,iOS,tvOS,watchOS} "$NEW_BUILD_VERSION"
eval xct versions set-marketing-version --targets\ eXtenderZ-{static,dynamic}-{macOS,visionOS,iOS,tvOS,watchOS} "$NEW_MARKETING_VERSION"
TAG_NAME="$NEW_MARKETING_VERSION"
git commit --allow-empty -am "Set build version to $NEW_BUILD_VERSION and marketing version to $NEW_MARKETING_VERSION with xct"
./Scripts/create-xcframeworks.swift "$NEW_MARKETING_VERSION"
git add Package.swift
git commit -am "Create the Package.swift file for SPM-compatibility"
git tag -sm "eXtenderZ $NEW_MARKETING_VERSION" "$TAG_NAME"
git push origin "$TAG_NAME"
- uses: actions/upload-artifact@v2
with:
name: xcframeworks
path: |
build/eXtenderZ-dynamic.xcframework.zip
build/eXtenderZ-static.xcframework.zip