-
Notifications
You must be signed in to change notification settings - Fork 429
135 lines (111 loc) · 4.62 KB
/
CI.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
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
# See the following, which includes links to supported macOS versions, including supported Xcode versions
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
jobs:
build:
strategy:
matrix:
xcode: [ "14.3.1" ]
platform: [ "all", "macos", "ios" ]
os: [ "macos-13" ]
upload_artifacts: [ true ]
# Legacy configurations
include:
- xcode: "12.5.1"
platform: "macos"
os: "macos-11"
upload_artifacts: false
fail-fast: false
name: 'MoltenVK (Xcode ${{ matrix.xcode }} - ${{ matrix.platform }})'
runs-on: ${{ matrix.os }}
env:
XCODE_DEV_PATH: "/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer"
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Select Xcode version
run: sudo xcode-select -switch "${XCODE_DEV_PATH}"
- name: Prep
id: prep
run: |
echo "Get Xcode version info"
XCODE_VERSION="$(xcodebuild -version)"
echo "${XCODE_VERSION}"
XCODE_VERSION="$(echo "${XCODE_VERSION}" | tr '\t\r\n ' '_')"
echo "${XCODE_VERSION}"
echo "XCODE_VERSION=${XCODE_VERSION}" >> $GITHUB_OUTPUT
- name: Cache Dependencies
id: cache-dependencies
if: success() && !(github.event_name == 'push' && contains(github.ref, 'refs/tags/')) # never cache dependencies for pushed tags
uses: actions/cache@v3
with:
path: |
External/build
!External/build/Intermediates
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: |
./fetchDependencies -v --none
- name: Fetch Dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
./fetchDependencies -v --${{ matrix.platform }}
- name: Output Dependency Build Logs on Failure
if: failure()
run: cat "dependenciesbuild.log"
- name: Build MoltenVK
run: |
make ${{ matrix.platform }}
- name: Output MoltenVK Build Logs on Failure
if: failure()
run: |
if [ -f "xcodebuild.log" ]; then
cat "xcodebuild.log"
fi
- name: Tar Artifacts
if: success() && matrix.upload_artifacts == true
# See: https://github.com/actions/upload-artifact#maintaining-file-permissions-and-case-sensitive-files
# 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/
- name: Upload Artifacts
if: success() && matrix.upload_artifacts == true
uses: actions/upload-artifact@v3
with:
name: "MoltenVK-${{ matrix.platform }}"
path: "MoltenVK-${{ matrix.platform }}.tar"
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:
# 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.
artifacts: "MoltenVK*/*"
artifactErrorsFailBuild: true