From fa78b9a4ccc6f567bc38fd6c6a86b95f9618e502 Mon Sep 17 00:00:00 2001 From: Quinton Miller Date: Tue, 19 Nov 2024 12:49:23 +0800 Subject: [PATCH] Make MinGW-w64 artifact a full installation --- .github/workflows/mingw-w64.yml | 58 +++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 17 deletions(-) diff --git a/.github/workflows/mingw-w64.yml b/.github/workflows/mingw-w64.yml index 8e5db39a5fa1..a09d579229c2 100644 --- a/.github/workflows/mingw-w64.yml +++ b/.github/workflows/mingw-w64.yml @@ -39,12 +39,6 @@ jobs: name: x86_64-mingw-w64-crystal-obj path: .build/crystal.obj - - name: Upload standard library - uses: actions/upload-artifact@v4 - with: - name: x86_64-mingw-w64-crystal-stdlib - path: src - x86_64-mingw-w64-link: runs-on: windows-2022 needs: [x86_64-mingw-w64-cross-compile] @@ -70,12 +64,6 @@ jobs: with: name: x86_64-mingw-w64-crystal-obj - - name: Download standard library - uses: actions/download-artifact@v4 - with: - name: x86_64-mingw-w64-crystal-stdlib - path: share/crystal/src - - name: Link Crystal executable shell: msys2 {0} run: | @@ -86,13 +74,49 @@ jobs: -lole32 -lWS2_32 -Wl,--stack,0x800000 ldd bin/crystal.exe | grep -iv /c/windows/system32 | sed 's/.* => //; s/ (.*//' | xargs -t -i cp '{}' bin/ + - name: Upload Crystal executable + uses: actions/upload-artifact@v4 + with: + name: x86_64-mingw-w64-crystal-exe + path: bin + + x86_64-mingw-w64-package: + runs-on: windows-2022 + needs: [x86_64-mingw-w64-link] + steps: + - name: Setup MSYS2 + id: msys2 + uses: msys2/setup-msys2@ddf331adaebd714795f1042345e6ca57bd66cea8 # v2.24.1 + with: + msystem: UCRT64 + update: true + install: >- + make + + - name: Disable CRLF line ending substitution + run: | + git config --global core.autocrlf false + + - name: Download Crystal source + uses: actions/checkout@v4 + + - name: Download Crystal executable + uses: actions/download-artifact@v4 + with: + name: x86_64-mingw-w64-crystal-exe + path: .build + + - name: Package Crystal + shell: msys2 {0} + run: | + make -o .build/crystal.exe install PREFIX="$(pwd)/crystal" + cp .build/*.dll crystal/bin/ + - name: Upload Crystal uses: actions/upload-artifact@v4 with: name: x86_64-mingw-w64-crystal - path: | - bin/ - share/ + path: bin x86_64-mingw-w64-test: runs-on: windows-2022 @@ -130,8 +154,8 @@ jobs: - name: Download Crystal executable uses: actions/download-artifact@v4 with: - name: x86_64-mingw-w64-crystal - path: crystal + name: x86_64-mingw-w64-crystal-exe + path: crystal/bin - name: Run stdlib specs shell: msys2 {0}