Compile and attach latest release with all targets #157
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: Compile and attach latest release with all targets | |
on: | |
schedule: | |
- cron: '0 0 * * FRI' | |
permissions: | |
contents: write | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
lookup-latest-github-release: | |
runs-on: ubuntu-22.04 | |
outputs: | |
target: ${{ steps.lookup.outputs.target }} | |
steps: | |
- id: lookup | |
run: | | |
echo "target=$(curl -L \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer $GITHUB_TOKEN" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest | jq --raw-output '.name')" >> $GITHUB_OUTPUT | |
generate-build-matrix: | |
runs-on: macos-14-xlarge | |
outputs: | |
xcodeversions: ${{ steps.generate.outputs.xcodeversions }} | |
steps: | |
- id: generate | |
run: | | |
version_list=() | |
for XCODE_INSTALL in $(ls /Applications | grep Xcode); do | |
version_list+=("$(/usr/libexec/PlistBuddy -c "print CFBundleShortVersionString" /Applications/$XCODE_INSTALL/Contents/Info.plist)") | |
done | |
unique_version_list=( $(printf "%s\n" ${version_list[@]} | sort -n -u) ) | |
jsonString="$(jq -c --null-input '$ARGS.positional' --args -- "${unique_version_list[@]}")" | |
echo "xcodeversions=$jsonString" >> $GITHUB_OUTPUT | |
attach-xcframework-to-github-release: | |
runs-on: macos-14-xlarge | |
needs: [ lookup-latest-github-release, generate-build-matrix ] | |
strategy: | |
fail-fast: false | |
matrix: | |
xcodeversion: ${{ fromJSON(needs.generate-build-matrix.outputs.xcodeversions) }} | |
steps: | |
- uses: actions/[email protected] | |
- uses: ./.github/actions/attachXcFrameworkAndChecksum | |
with: | |
target: ${{ needs.lookup-latest-github-release.outputs.target }} | |
xcodeversion: ${{ matrix.xcodeversion }} |