2020-12-08 11:13:41 -05:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
# Controls when the action will run.
|
|
|
|
on:
|
|
|
|
# Triggers the workflow on push or pull request events
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
2022-03-21 20:31:33 -04:00
|
|
|
# See the following, which includes links to supported macOS versions, including supported Xcode versions
|
2023-10-23 20:04:04 -04:00
|
|
|
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
|
2020-12-08 11:13:41 -05:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-10-23 20:04:04 -04:00
|
|
|
xcode: [ "15.0" ]
|
2023-05-10 16:46:41 -04:00
|
|
|
platform: [ "all", "macos", "ios" ]
|
2023-05-08 18:14:22 -04:00
|
|
|
os: [ "macos-13" ]
|
2021-02-03 15:59:50 -05:00
|
|
|
upload_artifacts: [ true ]
|
2023-07-12 16:38:32 -04:00
|
|
|
|
|
|
|
# Legacy configurations
|
2021-02-03 16:00:38 -05:00
|
|
|
include:
|
2022-09-23 13:22:53 -04:00
|
|
|
- xcode: "12.5.1"
|
2021-02-03 16:00:38 -05:00
|
|
|
platform: "macos"
|
2022-09-23 13:22:53 -04:00
|
|
|
os: "macos-11"
|
2021-02-03 16:00:38 -05:00
|
|
|
upload_artifacts: false
|
2020-12-08 11:13:41 -05:00
|
|
|
fail-fast: false
|
|
|
|
|
2021-02-03 15:59:50 -05:00
|
|
|
name: 'MoltenVK (Xcode ${{ matrix.xcode }} - ${{ matrix.platform }})'
|
2020-12-08 11:13:41 -05:00
|
|
|
|
2021-02-03 15:59:50 -05:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
env:
|
|
|
|
XCODE_DEV_PATH: "/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer"
|
2020-12-08 11:13:41 -05:00
|
|
|
|
|
|
|
steps:
|
|
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
2023-05-08 18:14:22 -04:00
|
|
|
- uses: actions/checkout@v3
|
2020-12-08 11:13:41 -05:00
|
|
|
|
|
|
|
- name: Select Xcode version
|
2020-12-09 09:47:08 -05:00
|
|
|
run: sudo xcode-select -switch "${XCODE_DEV_PATH}"
|
2020-12-08 11:13:41 -05:00
|
|
|
|
2020-12-08 13:21:57 -05:00
|
|
|
- name: Prep
|
|
|
|
id: prep
|
2020-12-08 11:36:29 -05:00
|
|
|
run: |
|
2020-12-08 13:21:57 -05:00
|
|
|
echo "Get Xcode version info"
|
|
|
|
XCODE_VERSION="$(xcodebuild -version)"
|
|
|
|
echo "${XCODE_VERSION}"
|
|
|
|
XCODE_VERSION="$(echo "${XCODE_VERSION}" | tr '\t\r\n ' '_')"
|
|
|
|
echo "${XCODE_VERSION}"
|
2023-05-08 18:14:22 -04:00
|
|
|
echo "XCODE_VERSION=${XCODE_VERSION}" >> $GITHUB_OUTPUT
|
2020-12-08 13:21:57 -05:00
|
|
|
|
|
|
|
- name: Cache Dependencies
|
|
|
|
id: cache-dependencies
|
|
|
|
if: success() && !(github.event_name == 'push' && contains(github.ref, 'refs/tags/')) # never cache dependencies for pushed tags
|
2023-05-08 18:14:22 -04:00
|
|
|
uses: actions/cache@v3
|
2020-12-08 13:21:57 -05:00
|
|
|
with:
|
2020-12-09 09:47:08 -05:00
|
|
|
path: |
|
|
|
|
External/build
|
|
|
|
!External/build/Intermediates
|
2020-12-08 13:21:57 -05:00
|
|
|
key: ${{ runner.os }}-${{ steps.prep.outputs.XCODE_VERSION }}-${{ matrix.platform }}-${{ hashFiles('fetchDependencies','ExternalRevisions/**','ExternalDependencies.xcodeproj/**','Scripts/**') }}
|
|
|
|
|
|
|
|
- name: Fetch Dependencies (Use Built Cache)
|
|
|
|
if: steps.cache-dependencies.outputs.cache-hit == 'true'
|
|
|
|
run: |
|
2020-12-09 15:19:17 -05:00
|
|
|
./fetchDependencies -v --none
|
2020-12-08 11:36:29 -05:00
|
|
|
|
2020-12-08 11:13:41 -05:00
|
|
|
- name: Fetch Dependencies
|
2020-12-08 13:21:57 -05:00
|
|
|
if: steps.cache-dependencies.outputs.cache-hit != 'true'
|
2020-12-08 11:13:41 -05:00
|
|
|
run: |
|
2020-12-09 15:19:17 -05:00
|
|
|
./fetchDependencies -v --${{ matrix.platform }}
|
2020-12-08 11:13:41 -05:00
|
|
|
|
2020-12-09 13:43:56 -05:00
|
|
|
- name: Output Dependency Build Logs on Failure
|
|
|
|
if: failure()
|
|
|
|
run: cat "dependenciesbuild.log"
|
|
|
|
|
2020-12-08 11:13:41 -05:00
|
|
|
- name: Build MoltenVK
|
|
|
|
run: |
|
2020-12-09 09:47:08 -05:00
|
|
|
make ${{ matrix.platform }}
|
2020-12-08 11:36:29 -05:00
|
|
|
|
2020-12-09 13:43:56 -05:00
|
|
|
- name: Output MoltenVK Build Logs on Failure
|
2020-12-08 11:36:29 -05:00
|
|
|
if: failure()
|
2020-12-09 13:43:56 -05:00
|
|
|
run: |
|
|
|
|
if [ -f "xcodebuild.log" ]; then
|
|
|
|
cat "xcodebuild.log"
|
|
|
|
fi
|
2020-12-08 11:36:29 -05:00
|
|
|
|
2020-12-08 12:02:55 -05:00
|
|
|
- name: Tar Artifacts
|
2021-02-03 15:59:50 -05:00
|
|
|
if: success() && matrix.upload_artifacts == true
|
2020-12-08 12:02:55 -05:00
|
|
|
# See: https://github.com/actions/upload-artifact#maintaining-file-permissions-and-case-sensitive-files
|
2023-05-10 16:46:41 -04:00
|
|
|
# To reduce artifact size, don't include any stand-alone shader converter binaries.
|
|
|
|
run: |
|
|
|
|
rm -rf Package/Release/MoltenVKShaderConverter
|
|
|
|
tar -C Package -s/Release/MoltenVK/ -cvf "MoltenVK-${{ matrix.platform }}.tar" Release/
|
2020-12-08 12:02:55 -05:00
|
|
|
|
|
|
|
- name: Upload Artifacts
|
2021-02-03 15:59:50 -05:00
|
|
|
if: success() && matrix.upload_artifacts == true
|
2023-05-08 18:14:22 -04:00
|
|
|
uses: actions/upload-artifact@v3
|
2020-12-08 12:02:55 -05:00
|
|
|
with:
|
2023-05-10 16:46:41 -04:00
|
|
|
name: "MoltenVK-${{ matrix.platform }}"
|
|
|
|
path: "MoltenVK-${{ matrix.platform }}.tar"
|
2023-05-09 18:40:14 -07:00
|
|
|
|
|
|
|
release:
|
|
|
|
name: 'Release'
|
|
|
|
|
|
|
|
needs: [build]
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Download Artifacts
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
|
|
|
|
- name: Create Release
|
|
|
|
uses: ncipollo/release-action@v1
|
|
|
|
with:
|
2023-05-12 10:11:11 -07:00
|
|
|
# Allow updating existing releases if the workflow is triggered by release creation or re-run.
|
|
|
|
allowUpdates: true
|
|
|
|
# When the release is updated, delete the existing artifacts for replacement.
|
|
|
|
removeArtifacts: true
|
|
|
|
# If a release is being replaced, omit updating the name and body.
|
|
|
|
# Allows for creating a release and filling these in before the workflow runs.
|
|
|
|
# Then, the workflow will populate the release with the artifacts.
|
|
|
|
omitNameDuringUpdate: true
|
|
|
|
omitBodyDuringUpdate: true
|
|
|
|
# Upload all MoltenVK CI artifacts as release assets.
|
2023-05-10 23:18:05 -07:00
|
|
|
artifacts: "MoltenVK*/*"
|
2023-05-09 18:40:14 -07:00
|
|
|
artifactErrorsFailBuild: true
|