1
0
mirror of https://github.com/dokku/buildpack-nginx.git synced 2026-04-24 01:27:37 +00:00

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.
This commit is contained in:
Jose Diaz-Gonzalez
2026-04-23 01:37:40 -04:00
parent df8cba3582
commit cad1e54b14
2 changed files with 14 additions and 43 deletions

View File

@ -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

View File

@ -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