From aaf995fd4edb4924929f99e9681752aa43a91993 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 23 Apr 2026 01:22:23 -0400 Subject: [PATCH 1/3] feat: add CI workflow to lint and compile nginx on PRs --- .github/workflows/ci.yml | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3c0ff30 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +--- +name: "ci" + +# yamllint disable-line rule:truthy +on: + pull_request: + branches: + - master + - main + push: + branches: + - master + - main + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Run shellcheck + run: make test + + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Download source tarballs + run: | + source "$GITHUB_WORKSPACE/conf/nginx-configure-flags" + cd /tmp + curl -sSL "https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" | tar xz + curl -sSL "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-${PCRE_VERSION}/pcre2-${PCRE_VERSION}.tar.gz" | tar xz + curl -sSL "https://github.com/madler/zlib/archive/v${ZLIB_VERSION}.tar.gz" | tar xz + + - name: Compile nginx + run: | + source "$GITHUB_WORKSPACE/conf/nginx-configure-flags" + cd /tmp/nginx-${NGINX_VERSION} + ./configure \ + --prefix=/tmp/nginx-build \ + --with-pcre=../pcre2-${PCRE_VERSION} \ + --with-zlib=../zlib-${ZLIB_VERSION} \ + "${NGINX_CONFIGURE_FLAGS[@]}" + sed -i "/CFLAGS/s/ \-O //g" objs/Makefile + make -j"$(nproc)" + + - name: Verify nginx binary + run: | + /tmp/nginx-build/nginx -V From df8cba3582e097ef79fc5ee69888d3c311b02e59 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 23 Apr 2026 01:33:27 -0400 Subject: [PATCH 2/3] fix: use correct path for nginx binary in CI verify step --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c0ff30..fb77690 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,4 +50,5 @@ jobs: - name: Verify nginx binary run: | - /tmp/nginx-build/nginx -V + source "$GITHUB_WORKSPACE/conf/nginx-configure-flags" + /tmp/nginx-${NGINX_VERSION}/objs/nginx -V From cad1e54b146d7e3fd7b8e8f695f1dd7aff4ac250 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 23 Apr 2026 01:37:40 -0400 Subject: [PATCH 3/3] refactor: merge release workflow into ci workflow The build job now handles both CI verification and release asset uploads, eliminating duplicated compilation logic between the two workflows. --- .github/workflows/ci.yml | 14 ++++++++++++ .github/workflows/release.yml | 43 ----------------------------------- 2 files changed, 14 insertions(+), 43 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb77690..f2714cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,9 +11,12 @@ on: branches: - master - main + release: + types: [created] jobs: lint: + if: github.event_name != 'release' runs-on: ubuntu-latest steps: - name: Checkout code @@ -52,3 +55,14 @@ jobs: run: | source "$GITHUB_WORKSPACE/conf/nginx-configure-flags" /tmp/nginx-${NGINX_VERSION}/objs/nginx -V + + - name: Upload release assets + if: github.event_name == 'release' + env: + GH_TOKEN: ${{ github.token }} + run: | + source "$GITHUB_WORKSPACE/conf/nginx-configure-flags" + cp /tmp/nginx-${NGINX_VERSION}/objs/nginx /tmp/nginx-linux-amd64 + chmod +x /tmp/nginx-linux-amd64 + gh release upload "${{ github.event.release.tag_name }}" \ + /tmp/nginx-linux-amd64 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 298b21b..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -name: "release" - -# yamllint disable-line rule:truthy -on: - release: - types: [created] - -jobs: - build-assets: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v6 - - - name: Download source tarballs - run: | - source "$GITHUB_WORKSPACE/conf/nginx-configure-flags" - cd /tmp - curl -sSL "https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" | tar xz - curl -sSL "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-${PCRE_VERSION}/pcre2-${PCRE_VERSION}.tar.gz" | tar xz - curl -sSL "https://github.com/madler/zlib/archive/v${ZLIB_VERSION}.tar.gz" | tar xz - - - name: Compile nginx - run: | - source "$GITHUB_WORKSPACE/conf/nginx-configure-flags" - cd /tmp/nginx-${NGINX_VERSION} - ./configure \ - --prefix=/tmp/nginx-build \ - --with-pcre=../pcre2-${PCRE_VERSION} \ - --with-zlib=../zlib-${ZLIB_VERSION} \ - "${NGINX_CONFIGURE_FLAGS[@]}" - sed -i "/CFLAGS/s/ \-O //g" objs/Makefile - make -j"$(nproc)" - cp objs/nginx /tmp/nginx-linux-amd64 - chmod +x /tmp/nginx-linux-amd64 - - - name: Upload release assets - env: - GH_TOKEN: ${{ github.token }} - run: | - gh release upload "${{ github.event.release.tag_name }}" \ - /tmp/nginx-linux-amd64