1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
name: Build Windows
on:
workflow_call:
inputs:
sha:
required: true
type: string
branch:
required: true
type: string
is_rolling_release:
required: true
type: string
is_release:
required: true
type: string
is_snapshot:
required: true
type: string
jobs:
build_win32:
runs-on: depot-ubuntu-24.04-4
strategy:
fail-fast: false
matrix:
system: [x64]
container:
image: savonet/liquidsoap-win32-${{ matrix.system }}
options: --user root -v ${{ github.workspace }}/${{ github.run_number }}:/tmp/${{ github.run_number }}
env:
OPAM_DEPS: ao-windows,lastfm-windows,camomile-windows,cry-windows,dtools-windows,duppy-windows,ffmpeg-windows,ffmpeg-avutil-windows,mm-windows,re-windows,portaudio-windows,samplerate-windows,sedlex-windows,ssl-windows,srt-windows,winsvc-windows,mem_usage-windows,prometheus-app-windows,cohttp-lwt-unix-windows
IS_SNAPSHOT: ${{ inputs.is_snapshot == 'true' }}
TOOLPREF64: /usr/src/mxe/usr/bin/x86_64-w64-mingw32.static-
steps:
- name: Get number of CPU cores
uses: savonet/github-actions-cpu-cores-docker@f72bcfaa219a2f60deaf8b26d0707b1d9c67d274 # v1
id: cpu_cores
- name: Checkout code
run: |
mkdir -p /tmp/${{ github.run_number }}/win32/liquidsoap
cd /tmp/${{ github.run_number }}/win32/liquidsoap
git init
git remote add origin https://github.com/${{ github.repository }}.git
git fetch origin ${{ inputs.sha }}
git checkout ${{ inputs.sha }}
chown -R opam /tmp/${{ github.run_number }}/win32
- name: Add local packages
run: |
cd /tmp/${{ github.run_number }}/win32/liquidsoap/
gosu opam:root ./.github/scripts/add-local-opam-packages.sh
- name: Build windows binary
run: |
mkdir -p /tmp/${{ github.run_number }}/win32/dist
chown -R opam /tmp/${{ github.run_number }}/win32/dist
chown -R opam "${GITHUB_OUTPUT}"
cd /tmp/${{ github.run_number }}/win32/liquidsoap
gosu opam:root ./.github/scripts/build-win32.sh ${{ matrix.system }} ${{ inputs.branch }} "${{ steps.cpu_cores.outputs.count }}" "${{ inputs.is_rolling_release }}" "${{ inputs.is_release }}" ${{ inputs.sha }}
id: build
- name: Upload artifact
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ${{ steps.build.outputs.basename }}
path: ${{ github.workspace }}/${{ github.run_number }}/win32/dist
if-no-files-found: error
- name: Cleanup
if: ${{ always() }}
run: |
rm -rf /tmp/${{ github.run_number }}/win32
|