Skip to content

Merge pull request #135 from salute-developers/release/25-12-2024 #21

Merge pull request #135 from salute-developers/release/25-12-2024

Merge pull request #135 from salute-developers/release/25-12-2024 #21

name: 'Build and Publish SDDS Components'
on:
push:
tags:
- "SDDSComponents-v[0-9]+.[0-9]+.[0-9]+" # Теги только для SDDSComponents
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
build-and-publish:
name: Build and Publish
runs-on: macos-latest
environment: sdds
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 'latest'
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
chmod +x ./scripts/install_certificate_and_profile.sh
./scripts/install_certificate_and_profile.sh "$RUNNER_TEMP" "$BUILD_CERTIFICATE_BASE64" "$P12_PASSWORD" "$BUILD_PROVISION_PROFILE_BASE64" "$KEYCHAIN_PASSWORD"
- name: Install dependencies
run: gem install xcodeproj
- name: Run build script for SDDSComponents
run: |
chmod +x ./scripts/build_xcframeworks.rb
ruby ./scripts/build_xcframeworks.rb -d . -p SDDSComponents/SDDSComponents.xcodeproj -m SDDSComponents
- name: Generate SDDSComponents zip
id: zip_artifact
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
# Указываем правильный путь к директории с xcframework
XCFRAMEWORK_PATH="./build/SDDSComponents.xcframework"
if [ -d "$XCFRAMEWORK_PATH" ]; then
# Если директория существует, создаем архив
zip -r "../../SDDSComponents-${TAG_NAME}.zip" "$XCFRAMEWORK_PATH"
else
echo "Error: $XCFRAMEWORK_PATH does not exist."
exit 1
fi
echo "::set-output name=zip_path::SDDSComponents-${TAG_NAME}.zip"
- name: Release SDDSComponents
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.zip_artifact.outputs.zip_path }}
tag_name: ${{ github.ref_name }}
token: ${{ secrets.GH_TOKEN }}