Skip to content

Commit ea7d58f

Browse files
committed
feat: Add windows-amd64-mingw target
1 parent 3d816ad commit ea7d58f

File tree

1 file changed

+59
-26
lines changed

1 file changed

+59
-26
lines changed

.github/workflows/ci.yml

+59-26
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,34 @@ jobs:
99
strategy:
1010
matrix:
1111
target:
12-
- id: 'linux-amd64'
13-
os: 'ubuntu-20.04'
14-
tar_extra_args: ''
15-
- id: 'linux-aarch64'
16-
os: "ubuntu-latest"
17-
# os: ['self-hosted', 'linux', 'ARM64']
18-
- id: 'linux-riscv64'
19-
os: "ubuntu-latest"
20-
# os: ['self-hosted', 'linux', 'RISCV64']
21-
- id: 'darwin-amd64'
22-
os: 'macos-13'
23-
tar_extra_args: ''
24-
- id: 'darwin-aarch64'
25-
os: 'macos-latest'
26-
tar_extra_args: ''
27-
# When unpacking an archive on Windows, the symlinks can't be
28-
# created unless the target path already exists. This causes
29-
# problems when the linked file is ordered after the link
30-
- id: 'windows-amd64'
12+
#- id: 'linux-amd64'
13+
# os: 'ubuntu-20.04'
14+
# tar_extra_args: ''
15+
#- id: 'linux-aarch64'
16+
# os: "ubuntu-latest"
17+
## os: ['self-hosted', 'linux', 'ARM64']
18+
#- id: 'linux-riscv64'
19+
# os: "ubuntu-latest"
20+
## os: ['self-hosted', 'linux', 'RISCV64']
21+
#- id: 'darwin-amd64'
22+
# os: 'macos-13'
23+
# tar_extra_args: ''
24+
#- id: 'darwin-aarch64'
25+
# os: 'macos-latest'
26+
# tar_extra_args: ''
27+
# # When unpacking an archive on Windows, the symlinks can't be
28+
# # created unless the target path already exists. This causes
29+
# # problems when the linked file is ordered after the link
30+
#- id: 'windows-amd64-msvc'
31+
# os: 'windows-2022'
32+
# # When unpacking an archive on Windows, the symlinks can't be
33+
# # created unless the target path already exists. This causes
34+
# # problems when the linked file is ordered after the link
35+
# # inside the archive. Dereferencing the files when packing them
36+
# # adds an additional copy per link, but it reliably works and
37+
# # the additional size is not too large on Windows.
38+
# tar_extra_args: '--dereference'
39+
- id: 'windows-amd64-mingw'
3140
os: 'windows-2022'
3241
# When unpacking an archive on Windows, the symlinks can't be
3342
# created unless the target path already exists. This causes
@@ -36,6 +45,7 @@ jobs:
3645
# adds an additional copy per link, but it reliably works and
3746
# the additional size is not too large on Windows.
3847
tar_extra_args: '--dereference'
48+
3949
llvm_version: ['18.x']
4050
llvm_repo_url: ['https://github.com/llvm/llvm-project.git']
4151
fail-fast: true
@@ -77,10 +87,16 @@ jobs:
7787
# choco install ninja
7888
- name: Setup MSVC (Windows)
7989
uses: ilammy/msvc-dev-cmd@v1
80-
if: matrix.target.id == 'windows-amd64'
90+
if: matrix.target.id == 'windows-amd64-msvc'
91+
92+
- name: Set up MinGW (Windows-mingw)
93+
uses: egor-tensin/setup-mingw@v2
94+
if: matrix.target.id == 'windows-amd64-mingw'
95+
with:
96+
platform: x64
8197

8298
- name: Build
83-
if: matrix.target.id != 'windows-amd64' && matrix.target.id != 'linux-aarch64' && matrix.target.id != 'linux-riscv64'
99+
if: (!startsWith(matrix.target.id, 'windows')) && matrix.target.id != 'linux-aarch64' && matrix.target.id != 'linux-riscv64'
84100
shell: bash
85101
run: |
86102
./build.sh ${{ matrix.llvm_version }} ${{ matrix.llvm_repo_url }}
@@ -98,8 +114,15 @@ jobs:
98114
./build.sh ${{ matrix.llvm_version }} ${{ matrix.llvm_repo_url }} riscv64
99115
100116
101-
- name: Build (Windows)
102-
if: matrix.target.id == 'windows-amd64'
117+
- name: Build (Windows-msvc)
118+
if: matrix.target.id == 'windows-amd64-msvc'
119+
#shell: |
120+
# powershell -Command "& '{0}'"
121+
run: |
122+
./build.sh ${{ matrix.llvm_version }} ${{ matrix.llvm_repo_url }}
123+
124+
- name: Build (Windows-mingw)
125+
if: matrix.target.id == 'windows-amd64-mingw'
103126
#shell: |
104127
# powershell -Command "& '{0}'"
105128
run: |
@@ -211,12 +234,22 @@ jobs:
211234
asset_name: llvm-darwin-aarch64.tar.xz
212235
asset_content_type: application/gzip
213236

214-
- name: Upload Release Asset Windows
237+
- name: Upload Release Asset Windows (msvc)
238+
uses: actions/upload-release-asset@v1
239+
env:
240+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
241+
with:
242+
upload_url: ${{ steps.create_release.outputs.upload_url }}
243+
asset_path: artifacts/windows-amd64-msvc-${{matrix.llvm_version}}/llvm.tar.xz
244+
asset_name: llvm-windows-amd64-msvc.tar.xz
245+
asset_content_type: application/gzip
246+
247+
- name: Upload Release Asset Windows (mingw)
215248
uses: actions/upload-release-asset@v1
216249
env:
217250
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
218251
with:
219252
upload_url: ${{ steps.create_release.outputs.upload_url }}
220-
asset_path: artifacts/windows-amd64-${{matrix.llvm_version}}/llvm.tar.xz
221-
asset_name: llvm-windows-amd64.tar.xz
253+
asset_path: artifacts/windows-amd64-mingw-${{matrix.llvm_version}}/llvm.tar.xz
254+
asset_name: llvm-windows-amd64-mingw.tar.xz
222255
asset_content_type: application/gzip

0 commit comments

Comments
 (0)