Skip to content

Commit

Permalink
11.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xq114 committed Mar 25, 2022
1 parent b765aec commit 0d59a9b
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: windows

on: push

jobs:
llvm:
strategy:
matrix:
arch: ["32", "64"]
version: ["11.0.0"]
runs-on: windows-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: false
- name: prepare llvm
run: |
python get_llvm_ps1.py ${{ matrix.version }} ${{ matrix.arch }}
./get_llvm_${{ matrix.version }}_${{ matrix.arch }}.ps1
- name: publish llvm to release
uses: svenstaro/upload-release-action@v2
with:
repo_name: xmake-mirror/llvm-windows
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: clang+llvm-${{ matrix.version }}-win${{ matrix.arch }}.zip
asset_name: clang+llvm-${{ matrix.version }}-win${{ matrix.arch }}.zip
tag: "${{ matrix.version }}"
body: "llvm for windows ${{ matrix.version }}"
24 changes: 24 additions & 0 deletions get_llvm_ps1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import sys

PS1_SOURCE = """
New-Item -Path . -Name llvm-install -ItemType "directory"
$InstallPath = (Resolve-Path -Path .\\llvm-install).Path
Invoke-WebRequest -Uri "https://github.com/llvm/llvm-project/releases/download/llvmorg-{llvmver}/LLVM-{llvmver}-win{bits}.exe" -OutFile .\\llvm.exe
.\\llvm.exe /S /D=$InstallPath | Wait-Job
Remove-Item -Path $InstallPath\\Uninstall.exe
Compress-Archive -Path $InstallPath\\* -DestinationPath .\\clang+llvm-{llvmver}-win{bits}.zip
"""

if __name__ == '__main__':
if len(sys.argv) < 2:
print("Usage: python " + __file__ + " <version> <bits>")
exit(1)
llvmver = sys.argv[1]
bits = "64"
if len(sys.argv) > 2:
bits = sys.argv[2]

with open(f"get_llvm_{llvmver}_{bits}.ps1", "w") as f:
f.write(PS1_SOURCE.format(llvmver=llvmver, bits=bits))

0 comments on commit 0d59a9b

Please sign in to comment.