如何在 GitHub 操作中安装旧版本的 Direct X Api

How to install an old version of the Direct X Api in GitHub actions

我正在 this project, which requires an old version of the DirectX SDK from June 2010 中实现持续集成。是否可以将其安装为 GitHub Actions 工作流程的一部分?它可以使用任何版本的 SDK 构建,只要它与 Windows 7.

兼容

Here's the workflow I've written so far, and here 是 Windows 指南的通用建筑,我正在关注...

我有一个使用 DX2010 的项目工作设置,但是我不是 运行ning 安装程序(在测试期间我总是失败,也许现在已经修复了)但只提取构建所需的部分。查看您提供的 link,这正是指南推荐的内容:)

首先,使用::set-env "command"设置DXSDK_DIR变量。变量最有可能指向默认位置之外的目录,如果在准备好 DX 文件后检出存储库,则可以覆盖该目录。

- name:  Config
  run:   echo ::set-env name=DXSDK_DIR::$HOME/cache/
  shell: bash

我不想在存储库中包含 DX 文件,因此必须在 运行ning 工作流程时下载它们。为了避免一遍又一遍地这样做 cache 操作用于在构建之间保留文件。

- name: Cache
  id:   cache
  uses: actions/cache@v1
  with:
   path: ~/cache
   key:  cache

最后,下载并解压 DX2010。仅当先前未创建缓存或当前工作流无法 create/restore 缓存(如 on: scheduleon: repository_dispatch)时,此步骤才会 运行。

- name:  Cache create
  if:    steps.cache.outputs.cache-hit != 'true'
  run:   |
         curl -L https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe -o _DX2010_.exe
         7z x _DX2010_.exe DXSDK/Include -o_DX2010_
         7z x _DX2010_.exe DXSDK/Lib/x86 -o_DX2010_
         mv _DX2010_/DXSDK $HOME/cache
         rm -fR _DX*_ _DX*_.exe
  shell: bash

Aa 就是这样,项目已准备好编译。