ci: add windows build #17
Workflow file for this run
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 | |
on: | |
pull_request: | |
push: | |
branches: | |
- "master" | |
- "sidechain" | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
name: Build binaries | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: work | |
# This caches the Go installation | |
- uses: actions/setup-go@v4 | |
- uses: msys2/setup-msys2@v2 | |
if: runner.os == 'Windows' | |
- name: Download Windows dependencies | |
uses: actions/checkout@v4 | |
if: runner.os == 'Windows' | |
with: | |
repository: dlfcn-win32/dlfcn-win32 | |
path: dlfcn-win32 | |
# master, as of 17.01.2024 | |
ref: 048bff80f2bd00bb651bcc3357cb6f76e3d76fd5 | |
- name: Install Windows dependencies | |
if: runner.os == 'Windows' | |
# List of existing Windows package on the runners | |
# https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md | |
working-directory: dlfcn-win32 | |
shell: bash | |
run: | | |
./configure --prefix=/ --libdir=${{ github.workspace }}/dlfcn-win32/libdir --incdir=${{ github.workspace }}/dlfcn-win32/incdir | |
make | |
cp libdl.a C:/mingw64/lib/ | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Compile rust lib | |
shell: bash | |
working-directory: work | |
run: make rust | |
- name: bash the head | |
shell: bash | |
working-directory: work | |
run: cat drivechain/target/.rustc_info.json | |
# # For some arcane reason there's a difference in what library files | |
# # are produced on my (Torkel) local machine and CI. Locally, the | |
# - name: shuffle around libs | |
# if: runner.os == 'Windows' | |
# shell: bash | |
# working-directory: work | |
# run: | | |
# cp drivechain/target/debug/drivechain_eth.d drivechain/target/debug/libdrivechain_eth.d | |
- name: Compile binary | |
shell: bash | |
working-directory: work | |
run: make geth | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: binaries-${{ runner.os }} | |
if-no-files-found: error | |
# TODO: Update these when renaming the binaries produced | |
path: work/build/bin/geth |