From ea15d2b3b1afc4b816337feb88458fafd8ebc5a6 Mon Sep 17 00:00:00 2001 From: Ioannis Tsakpinis Date: Thu, 1 Mar 2018 19:11:24 +0200 Subject: [PATCH] LWJGL configuration --- .gitattributes | 1 + .github/workflows/CI.yml | 140 ------------------------------------ .github/workflows/lwjgl.yml | 71 ++++++++++++++++++ fetchDependencies | 1 + 4 files changed, 73 insertions(+), 140 deletions(-) create mode 100644 .gitattributes delete mode 100644 .github/workflows/CI.yml create mode 100644 .github/workflows/lwjgl.yml diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..774506262 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* -text diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml deleted file mode 100644 index 9ee53ee47..000000000 --- a/.github/workflows/CI.yml +++ /dev/null @@ -1,140 +0,0 @@ -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/about-github-hosted-runners#supported-runners-and-hardware-resources -jobs: - build: - strategy: - matrix: - xcode: [ "15.0" ] - 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 - - # Python 3.12 removed distutils, which is used by glslang::update_glslang_sources.py called from fetchDependencies - - uses: actions/setup-python@v4 - with: - python-version: '3.11' - - - 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 diff --git a/.github/workflows/lwjgl.yml b/.github/workflows/lwjgl.yml new file mode 100644 index 000000000..505d5dd86 --- /dev/null +++ b/.github/workflows/lwjgl.yml @@ -0,0 +1,71 @@ +name: LWJGL Build + +on: + workflow_dispatch: + push: + branches: + - main + +env: + AWS_DEFAULT_REGION: us-east-1 + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + S3_PARAMS: --cache-control "public,must-revalidate,proxy-revalidate,max-age=0" + +jobs: + macos: + name: macOS + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + ARCH: [x64, arm64] + include: + - ARCH: x64 + ARCHS: x86_64 + MACOS: 10.13 + - ARCH: arm64 + ARCHS: arm64 + MACOS: 11.0 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 3 + - name: Cache key preparation + run: | + XCODE_VERSION="$(xcodebuild -version)" + XCODE_VERSION="$(echo "${XCODE_VERSION}" | tr '\t\r\n ' '_')" + echo "::set-output name=XCODE_VERSION::${XCODE_VERSION}" + id: cache-key-prep + - name: Cache Dependencies + uses: actions/cache@v2 + id: cache-dependencies + with: + path: | + External/build + !External/build/Intermediates + key: ${{runner.os}}-${{steps.cache-key-prep.outputs.XCODE_VERSION}}-${{matrix.ARCH}}-${{hashFiles('fetchDependencies','ExternalRevisions/**','ExternalDependencies.xcodeproj/**','Scripts/**')}} + - name: Fetch Dependencies (Use Built Cache) + run: ./fetchDependencies -v --none + if: steps.cache-dependencies.outputs.cache-hit == 'true' + - name: Fetch Dependencies + run: ARCHS=${{matrix.ARCHS}} ./fetchDependencies -v --macos + if: steps.cache-dependencies.outputs.cache-hit != 'true' + - name: Print dependencies log on failure + run: cat dependenciesbuild.log + if: failure() + - name: Build + run: | + xcodebuild -verbose -project MoltenVKPackaging.xcodeproj -scheme "MoltenVK Package (macOS only)" -configuration Release MACOSX_DEPLOYMENT_TARGET=${{matrix.MACOS}} ARCHS=${{matrix.ARCHS}} GCC_PREPROCESSOR_DEFINITIONS='$GCC_PREPROCESSOR_DEFINITIONS MVK_LOGGING_ENABLED=0' -derivedDataPath bin build -IDEBuildOperationMaxNumberOfConcurrentCompileTasks=4 + ls -la bin + ls -la Package + strip -u -r Package/Latest/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib + - name: Print log on failure + run: cat "xcodebuild.log" + if: failure() + - name: Upload artifact + run: aws s3 cp Package/Latest/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib s3://lwjgl-build/nightly/macosx/${{matrix.ARCH}}/ $S3_PARAMS + - name: Upload git revision + run: | + git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libMoltenVK.dylib.git + aws s3 cp libMoltenVK.dylib.git s3://lwjgl-build/nightly/macosx/${{matrix.ARCH}}/ $S3_PARAMS diff --git a/fetchDependencies b/fetchDependencies index a870c300a..ce81bbb9d 100755 --- a/fetchDependencies +++ b/fetchDependencies @@ -455,6 +455,7 @@ function build_impl() { -enableUndefinedBehaviorSanitizer "${XC_USE_UBSAN}" \ -derivedDataPath "${XC_LCL_DD_PATH}" \ ${XC_BUILD_VERBOSITY} \ + ${LWJGL_PARAMS} \ build echo Completed building external libraries for ${XC_PLTFM}