|
| 1 | +name: get-latest-msvc-2019-build-tools |
| 2 | + |
| 3 | +on: |
| 4 | + issue_comment: |
| 5 | + types: [created] |
| 6 | + |
| 7 | +jobs: |
| 8 | + delete_msvc2019_latest: |
| 9 | + name: Delete tag msvc2019_latest |
| 10 | + if: ${{ !github.event.issue.pull_request && contains(github.event.issue.labels.*.name, 'get_msvc2019') && github.event.issue.user.login == 'nonwill' && github.triggering_actor == 'nonwill' && github.event.comment.user.login == 'nonwill' }} |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: Check out Git repository |
| 14 | + uses: actions/checkout@v1 |
| 15 | + - name: Delete msvc2019_latest assets |
| 16 | + uses: andreaswilli/delete-release-assets-action@v3.0.0 |
| 17 | + with: |
| 18 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 19 | + tag: msvc2019_latest |
| 20 | + deleteOnlyFromDrafts: false |
| 21 | + |
| 22 | + get_latest_msvc2019: |
| 23 | + needs: delete_msvc2019_latest |
| 24 | + name: Get latest msvc 2019 build tools |
| 25 | + if: ${{ !github.event.issue.pull_request && contains(github.event.issue.labels.*.name, 'get_msvc2019') && github.event.issue.user.login == 'nonwill' && github.triggering_actor == 'nonwill' && github.event.comment.user.login == 'nonwill' }} |
| 26 | + runs-on: windows-2019 |
| 27 | + steps: |
| 28 | + - uses: ilammy/msvc-dev-cmd@v1 |
| 29 | + - name: Get version information |
| 30 | + id: vars |
| 31 | + shell: bash |
| 32 | + run: | |
| 33 | + echo "update_date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT |
| 34 | + echo "vc_install_dir=$VCToolsInstallDir" >> $GITHUB_OUTPUT |
| 35 | + echo "cl_exe_info=$(cl > cl_version 2>&1 && head -n 1 cl_version)" >> $GITHUB_OUTPUT |
| 36 | +
|
| 37 | + - name: msvc-build tools |
| 38 | + shell: cmd |
| 39 | + run: | |
| 40 | + echo winSdkVer=%WindowsSdkVersion% |
| 41 | + echo winSdkDir=%WindowsSdkDir% |
| 42 | + echo vcToolsInstallDir=%VCToolsInstallDir% |
| 43 | + cl.exe |
| 44 | + mkdir vcToolsInstallDir Auxiliary |
| 45 | + echo Copy VC Auxiliary Build |
| 46 | + cd Auxiliary && mkdir Build |
| 47 | + xcopy "%vcToolsInstallDir%../../../Auxiliary/Build" Build /Y /E /I /Q /H /C |
| 48 | + cd .. && cd vcToolsInstallDir && mkdir Auxiliary crt include atlmfc bin lib |
| 49 | + echo Copy Auxiliary, crt, include |
| 50 | + xcopy "%vcToolsInstallDir%Auxiliary" Auxiliary /Y /E /I /Q /H /C |
| 51 | + xcopy "%vcToolsInstallDir%crt" crt /Y /E /I /Q /H /C |
| 52 | + xcopy "%vcToolsInstallDir%include" include /Y /E /I /Q /H /C |
| 53 | + cd atlmfc && mkdir include lib src |
| 54 | + echo Copy atlmfc: include, src |
| 55 | + xcopy "%vcToolsInstallDir%atlmfc/include" include /Y /E /I /Q /H /C |
| 56 | + xcopy "%vcToolsInstallDir%atlmfc/src" src /Y /E /I /Q /H /C |
| 57 | + cd lib && mkdir x64 x86 |
| 58 | + echo Copy atlmfc: lib - x64 and x86 |
| 59 | + xcopy "%vcToolsInstallDir%atlmfc/lib/x64" x64 /Y /E /I /Q /H /C |
| 60 | + xcopy "%vcToolsInstallDir%atlmfc/lib/x86" x86 /Y /E /I /Q /H /C |
| 61 | + cd .. && cd .. && cd bin && mkdir Hostx64 Hostx86 |
| 62 | + cd Hostx64 && mkdir x64 x86 |
| 63 | + echo Copy bin: Hostx64 - x64 and x86 |
| 64 | + xcopy "%vcToolsInstallDir%bin/Hostx64/x64" x64 /Y /E /I /Q /H /C |
| 65 | + xcopy "%vcToolsInstallDir%bin/Hostx64/x86" x86 /Y /E /I /Q /H /C |
| 66 | + cd .. && cd Hostx86 && mkdir x64 x86 |
| 67 | + echo Copy bin: Hostx86 - x64 and x86 |
| 68 | + xcopy "%vcToolsInstallDir%bin/Hostx86/x64" x64 /Y /E /I /Q /H /C |
| 69 | + xcopy "%vcToolsInstallDir%bin/Hostx86/x86" x86 /Y /E /I /Q /H /C |
| 70 | + cd .. && cd .. && cd lib && mkdir x64 x86 |
| 71 | + echo Copy lib: x64 and x86 |
| 72 | + xcopy "%vcToolsInstallDir%lib/x64" x64 /Y /E /I /Q /H /C |
| 73 | + xcopy "%vcToolsInstallDir%lib/x86" x86 /Y /E /I /Q /H /C |
| 74 | + cd .. |
| 75 | + del /S /Q *.pdb |
| 76 | + cd .. |
| 77 | +
|
| 78 | + - name: zip VC_Auxiliary |
| 79 | + uses: thedoctor0/zip-release@0.7.1 |
| 80 | + with: |
| 81 | + type: 'zip' |
| 82 | + path: Auxiliary |
| 83 | + filename: 'vc_Auxiliary.zip' |
| 84 | + |
| 85 | + - name: zip atlmfc |
| 86 | + uses: thedoctor0/zip-release@0.7.1 |
| 87 | + with: |
| 88 | + type: 'zip' |
| 89 | + path: vcToolsInstallDir/atlmfc |
| 90 | + filename: 'atlmfc.zip' |
| 91 | + |
| 92 | + - name: zip Auxiliary |
| 93 | + uses: thedoctor0/zip-release@0.7.1 |
| 94 | + with: |
| 95 | + type: 'zip' |
| 96 | + path: vcToolsInstallDir/Auxiliary |
| 97 | + filename: 'Auxiliary.zip' |
| 98 | + |
| 99 | + - name: zip crt |
| 100 | + uses: thedoctor0/zip-release@0.7.1 |
| 101 | + with: |
| 102 | + type: 'zip' |
| 103 | + path: vcToolsInstallDir/crt |
| 104 | + filename: 'crt.zip' |
| 105 | + |
| 106 | + - name: zip include |
| 107 | + uses: thedoctor0/zip-release@0.7.1 |
| 108 | + with: |
| 109 | + type: 'zip' |
| 110 | + path: vcToolsInstallDir/include |
| 111 | + filename: 'include.zip' |
| 112 | + |
| 113 | + - name: zip lib/x64 |
| 114 | + uses: thedoctor0/zip-release@0.7.1 |
| 115 | + with: |
| 116 | + type: 'zip' |
| 117 | + path: vcToolsInstallDir/lib/x64 |
| 118 | + filename: 'lib_x64.zip' |
| 119 | + |
| 120 | + - name: zip lib/x86 |
| 121 | + uses: thedoctor0/zip-release@0.7.1 |
| 122 | + with: |
| 123 | + type: 'zip' |
| 124 | + path: vcToolsInstallDir/lib/x86 |
| 125 | + filename: 'lib_x86.zip' |
| 126 | + |
| 127 | + - name: zip bin/Hostx64 |
| 128 | + uses: thedoctor0/zip-release@0.7.1 |
| 129 | + with: |
| 130 | + type: 'zip' |
| 131 | + path: vcToolsInstallDir/bin/Hostx64 |
| 132 | + filename: 'bin_Hostx64.zip' |
| 133 | + |
| 134 | + - name: zip bin/Hostx86 |
| 135 | + uses: thedoctor0/zip-release@0.7.1 |
| 136 | + with: |
| 137 | + type: 'zip' |
| 138 | + path: vcToolsInstallDir/bin/Hostx86 |
| 139 | + filename: 'bin_Hostx86.zip' |
| 140 | + |
| 141 | + - name: Create Release and Upload Release Asset |
| 142 | + uses: softprops/action-gh-release@v1 |
| 143 | + with: |
| 144 | + tag_name: msvc2019_latest |
| 145 | + name: Latest msvc-2019 build tools for Windows x86/x64 |
| 146 | + body: | |
| 147 | + date: ${{ steps.vars.outputs.update_date }} |
| 148 | + from: ${{ steps.vars.outputs.vc_install_dir }} |
| 149 | + cl.exe: ${{ steps.vars.outputs.cl_exe_info }} |
| 150 | + draft: false |
| 151 | + prerelease: false |
| 152 | + files: | |
| 153 | + vc_Auxiliary.zip |
| 154 | + Auxiliary.zip |
| 155 | + include.zip |
| 156 | + crt.zip |
| 157 | + atlmfc.zip |
| 158 | + lib_x64.zip |
| 159 | + lib_x86.zip |
| 160 | + bin_Hostx64.zip |
| 161 | + bin_Hostx86.zip |
0 commit comments