Skip to content

TEMP

TEMP #527

Workflow file for this run

name: binaries
on:
push:
# Don't run on version tags (these are used for JS module).
tags-ignore:
- 'v**'
branches:
- '**'
paths:
- .github/workflows/binaries.yml
- patches/*
- scripts/*
pull_request:
schedule:
- cron: '0 0 * * 0' # run each Sunday
env:
ALPINE_BRANCH: v3.18
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JOBS: 3
CFLAGS: -Os -fomit-frame-pointer -pipe
LINUX_LDFLAGS: -static -Wl,--as-needed -Wl,-Map,linker.map
DARWIN_LDFLAGS: -Wl,-map,linker.map
WIN32_LDFLAGS: -Wl,--as-needed -Wl,-Map,linker.map
# List of extra nginx modules to download.
# NOTE: nginx/njs is not defined here, but directly in the jobs.
NGINX_MODULES: >-
kjdev/nginx-auth-jwt
kjdev/nginx-keyval
vision5/ngx_devel_kit
openresty/echo-nginx-module
openresty/headers-more-nginx-module
openresty/set-misc-nginx-module
# The same as above, but for Windows.
# - kjdev/nginx-auth-jwt, kjdev/nginx-keyval: a bit complicated to build (TODO)
NGINX_MODULES_WIN32: >-
vision5/ngx_devel_kit
openresty/echo-nginx-module
openresty/headers-more-nginx-module
openresty/set-misc-nginx-module
# Don't update binaries with unchanged sources.
SKIP_SAME_SOURCES: true
jobs:
nginx-x86_64-win32:
name: nginx-${{ matrix.NGINX_VERSION }}-x86_64-win32
runs-on: windows-latest
strategy:
matrix:
NGINX_VERSION:
- 1.24.x
- 1.25.x
- 1.26.x
steps:
- name: Setup MSYS2 and install packages
uses: msys2/setup-msys2@v2
with:
update: false
install: base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-jq
- name: Checkout master branch
uses: actions/checkout@v4
with:
path: master
- name: Download and extract nginx
shell: msys2 {0}
run: ./master/scripts/fetch-sources -d . nginx/nginx@release-${{ matrix.NGINX_VERSION }}
- name: Download and extract nginx MSYS2 patches
shell: msys2 {0}
run: ./master/scripts/fetch-sources -d msys2 "myfreeer/[email protected]"
- name: Download and extract nginx modules
shell: msys2 {0}
run: ./master/scripts/fetch-sources $NGINX_MODULES_WIN32
- name: Download and extract libraries
shell: msys2 {0}
run: ./master/scripts/fetch-sources '[email protected]' '[email protected]' 'madler/[email protected]'
- name: Apply patches
shell: msys2 {0}
run: |
case "${{ matrix.NGINX_VERSION }}" in
1.2[0-2].x)
for i in msys2/nginx-*.patch; do
patch -p1 < $i
done
;;
# Other patches are not needed since 1.23.4.
*) patch -p1 < msys2/nginx-0007-logs-write-access-log-to-stderr.patch;;
esac
- name: Build nginx
shell: msys2 {0}
env:
NGINX_MODULES: ${{ env.NGINX_MODULES_WIN32 }}
# -DFD_SETSIZE=1024 is per official nginx win32 binary.
CFLAGS: ${{ env.CFLAGS }} -DFD_SETSIZE=1024
LDFLAGS: ${{ env.WIN32_LDFLAGS }}
run: ./master/scripts/build-nginx
- name: Upload nginx binary to artifacts
uses: actions/upload-artifact@v4
with:
name: nginx-${{ matrix.NGINX_VERSION }}-x86_64-win32
path: artifact/*