1.4.0 #4
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: Upload Assets | |
defaults: | |
run: | |
shell: bash -eo pipefail {0} | |
on: | |
release: | |
types: [published] | |
jobs: | |
xcframework: | |
strategy: | |
matrix: | |
os: [macOS-13] | |
xcode: ['15.0'] | |
name: Upload XCFramework Assets | |
runs-on: ${{ matrix.os }} | |
env: | |
TMPDIR: /tmp/.cborcoding.assets-xcframework.build | |
steps: | |
- name: Select Xcode Version | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: ${{ matrix.xcode }} | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup Environment | |
run: | | |
mkdir -p "${TMPDIR}/Output" | |
mkdir -p "${TMPDIR}/Logs" | |
- name: Build | |
run: | | |
./scripts/xcframework.sh --build-dir "${TMPDIR}" --output "${TMPDIR}/Output/CBORCoding.xcframework" -- RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES | |
- name: Create Zip | |
run: | | |
cd "${TMPDIR}/Output" | |
zip -rX CBORCoding.xcframework.zip CBORCoding.xcframework 2>&1 | tee "${TMPDIR}/Logs/Zip.log" | |
- name: Upload Zip | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ${{ env.TMPDIR }}/Output/CBORCoding.xcframework.zip | |
asset_name: CBORCoding.xcframework.zip | |
asset_content_type: application/zip | |
- name: Create Tar | |
run: | | |
cd "${TMPDIR}/Output" | |
tar -zcvf CBORCoding.xcframework.tar.gz CBORCoding.xcframework 2>&1 | tee "${TMPDIR}/Logs/Tar.log" | |
- name: Upload Tar | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ${{ env.TMPDIR }}/Output/CBORCoding.xcframework.tar.gz | |
asset_name: CBORCoding.xcframework.tar.gz | |
asset_content_type: application/gzip | |
- name: Upload Logs | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: XCFrameworkLogs | |
path: ${{ env.TMPDIR }}/Logs/*.log | |
documentation: | |
strategy: | |
matrix: | |
os: [macOS-13] | |
xcode: ['15.0'] | |
name: Upload Documentation Assets | |
runs-on: ${{ matrix.os }} | |
env: | |
TMPDIR: /tmp/.cborcoding.assets-documentation.build | |
steps: | |
- name: Select Xcode Version | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: ${{ matrix.xcode }} | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup Environment | |
run: | | |
mkdir -p "${TMPDIR}/Output" | |
mkdir -p "${TMPDIR}/Logs" | |
- name: Build | |
run: | | |
xcodebuild docbuild -workspace "CBORCoding.xcworkspace" -scheme "CBORCoding" -destination "generic/platform=iOS" -derivedDataPath "${TMPDIR}/.docbuild" 2>&1 | tee "${TMPDIR}/Logs/Build.log" | |
DOCC_ARCHIVE="$(find "${TMPDIR}/.docbuild" -type d -name "CBORCoding.doccarchive")" | |
mv "${DOCC_ARCHIVE%/}" "${TMPDIR}/Output/CBORCoding.doccarchive" | |
- name: Create Zip | |
run: | | |
cd "${TMPDIR}/Output" | |
zip -rX CBORCoding.doccarchive.zip CBORCoding.doccarchive 2>&1 | tee "${TMPDIR}/Logs/Zip.log" | |
- name: Upload Zip | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ${{ env.TMPDIR }}/Output/CBORCoding.doccarchive.zip | |
asset_name: CBORCoding.doccarchive.zip | |
asset_content_type: application/zip | |
- name: Create Tar | |
run: | | |
cd "${TMPDIR}/Output" | |
tar -zcvf CBORCoding.doccarchive.tar.gz CBORCoding.doccarchive 2>&1 | tee "${TMPDIR}/Logs/Tar.log" | |
- name: Upload Tar | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ${{ env.TMPDIR }}/Output/CBORCoding.doccarchive.tar.gz | |
asset_name: CBORCoding.doccarchive.tar.gz | |
asset_content_type: application/gzip | |
- name: Upload Logs | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: DocumentationLogs | |
path: ${{ env.TMPDIR }}/Logs/*.log |