CI: Migrate from vmactions/freebsd-vm action to cross-platform-action… #142
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build_windows | |
on: | |
pull_request: | |
push: | |
env: | |
BRANCH: ${{ github.base_ref || github.ref_name }} | |
jobs: | |
build_lld: | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [x86, x64] | |
name: Build LLD ${{ matrix.arch }} | |
runs-on: windows-2019 | |
timeout-minutes: 120 | |
env: | |
VSINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\ | |
# NB: update windows/build_lld.sha256sums as well | |
LLVM_VER: 9.0.0 | |
ARCH: ${{ matrix.arch }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- shell: cmd | |
run: call windows\build_lld.bat || exit /b | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: lld-${{ matrix.arch }} | |
path: artifacts/ | |
build_mingw_libs: | |
name: Build MinGW-based libs | |
runs-on: windows-2019 | |
timeout-minutes: 120 | |
env: | |
VSINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\ | |
# NB: update windows/build_mingw.sha256sums as well | |
MINGW_VER: 8.0.0 | |
D_VERSION: 2.077.1 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- shell: cmd | |
run: call windows\build_mingw.bat || exit /b | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: mingw-libs | |
path: artifacts/ | |
build_curl: | |
name: Build curl | |
runs-on: windows-2019 | |
timeout-minutes: 120 | |
env: | |
VSINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\ | |
# NB: update windows/build_curl.sha256sums as well | |
CURL_VER: 7.68.0 | |
ZLIB_VER: 1.2.11 | |
PEXPORTS_VER: 0.47 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- shell: cmd | |
run: call windows\build_curl.bat || exit /b | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: curl | |
path: artifacts/ | |
build_docs: | |
name: Build docs | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 120 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Clone repos | |
run: | | |
set -eux | |
git clone --branch $BRANCH https://github.com/dlang/dlang.org.git work/dlang.org | |
git clone --branch $BRANCH https://github.com/dlang/dmd.git work/dmd | |
git clone --branch $BRANCH https://github.com/dlang/phobos.git work/phobos | |
- name: Build docs | |
run: make -C work/dlang.org -f posix.mak release | |
- name: Zip | |
run: | | |
set -eux | |
mkdir -p work/docs | |
zip -r work/docs/docs.zip work/dlang.org/web | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: docs | |
path: work/docs | |
build_release: | |
name: Build release | |
runs-on: windows-2019 | |
timeout-minutes: 120 | |
needs: build_docs | |
env: | |
LDC_VSDIR: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\ | |
HOST_LDC_VERSION: 1.23.0 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Download docs artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: docs | |
path: docs/ | |
- name: Install prerequisites | |
shell: bash | |
run: | | |
set -eux | |
powershell -command "& { iwr https://github.com/ldc-developers/ldc/releases/download/v$HOST_LDC_VERSION/ldc2-$HOST_LDC_VERSION-windows-multilib.7z -OutFile ldc.7z }" | |
7z x ldc.7z | |
mv ldc2-$HOST_LDC_VERSION-windows-multilib ldc2 | |
powershell -command "& { iwr https://downloads.dlang.org/other/dm857c.zip -OutFile dmc.zip }" | |
7z x dmc.zip | |
powershell -command "& { iwr http://ftp.digitalmars.com/sppn.zip -OutFile sppn.zip }" | |
7z x -odm/bin sppn.zip | |
powershell -command "& { iwr http://ftp.digitalmars.com/bup.zip -OutFile bup.zip }" | |
7z x bup.zip dm/bin/implib.exe | |
powershell -command "& { iwr https://nsis.sourceforge.io/mediawiki/images/c/c9/Inetc.zip -OutFile inetc.zip }" | |
7z x inetc.zip -y -bb1 '-oc:\Program Files (x86)\NSIS' | |
- name: Unzip docs | |
shell: bash | |
run: | | |
set -eux | |
unzip docs/docs.zip | |
mv work/dlang.org/web create_dmd_release/docs | |
- name: Build release | |
shell: bash | |
run: | | |
set -eux | |
powershell -command "& { iwr https://dlang.org/d-keyring.gpg -OutFile d-keyring.gpg }" | |
gpg --import d-keyring.gpg | |
export PATH="$PWD/dm/bin:$PATH" | |
cd create_dmd_release | |
../ldc2/bin/ldmd2 -g build_all.d common.d -version=NoVagrant | |
cp ../ldc2/bin/libcurl.dll . | |
./build_all v$HOST_LDC_VERSION $BRANCH | |
- name: Unzip build | |
shell: bash | |
run: 7z x create_dmd_release/build/dmd.$BRANCH.windows.zip -odmd.$BRANCH.windows | |
- name: Build installer | |
shell: cmd | |
run: | | |
@echo on | |
"c:\Program Files (x86)\NSIS\makensis" /version | |
for /f %%v in (dmd.%BRANCH%.windows\dmd2\src\version) do set ver=%%v | |
cd windows || exit /b | |
"c:\Program Files (x86)\NSIS\makensis" /DVersion2=%ver% /DEmbedD2Dir=..\dmd.%BRANCH%.windows\dmd2 d2-installer.nsi || exit /b | |
cd .. || exit /b | |
mkdir artifacts || exit /b | |
copy windows\*.exe artifacts || exit /b | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: win_release | |
path: artifacts/ |