Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pipeline to release plugin. #206

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Ubuntu

on:
push:
branches:
- fork/*
- master
pull_request:
branches:
- fork/*
- master
release:
types: [created]

env:
CTEST_OUTPUT_ON_FAILURE: 1

jobs:
build:
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci osx') && !contains(github.event.head_commit.message, 'ci win')"

runs-on: ubuntu-latest
strategy:
matrix:
nginx: [ '1.21.0', '1.21.1' ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we use latest stable release too? (and latest mainline release)

Suggested change
nginx: [ '1.21.0', '1.21.1' ]
nginx: [ '1.22.0', '1.21.6' ]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just saw the PR date and understood why those were the versions :)

steps:

- name: Checkout module
uses: actions/checkout@v2
with:
submodules: true
lfs: true
fetch-depth: 0

- name: Set env
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "GIT_TAG_NAME=$(git describe --tag --always --long)" >> $GITHUB_ENV
echo "GIT_TAG=$(git describe --tag --always --long)" >> $GITHUB_ENV
echo "GIT_RELEASE_NOTES="$(git log $(git describe --tags --abbrev=0 --always)..HEAD --pretty=format:"%h - %s (%an)<br>")"" >> $GITHUB_ENV

- name: Create release ${{ env.GIT_TAG }}
if: github.ref == 'refs/heads/master' && strategy.job-index == 0
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.GIT_TAG }}
release_name: ${{ format('{0}{1}{2}', '', env.GIT_TAG, '') }}
body: ${{ env.GIT_RELEASE_NOTES }}
draft: false
prerelease: false

- name: Checkout source
uses: actions/checkout@v2
with:
repository: 'nginx/nginx' #release-1.21.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we don't have to repeat ourselves each time upgrading nginx.

Suggested change
repository: 'nginx/nginx' #release-1.21.1
repository: 'nginx/nginx'

path: 'nginx'
ref: 'release-${{ matrix.nginx }}'
submodules: true
lfs: true
fetch-depth: 0

- name: Compile Module
run: |
cp ./configure ./nginx/configure
cd nginx
chmod +x ./configure
./configure --with-compat --add-dynamic-module=..
make modules


- name: Get release
id: get_release
uses: thebritican/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload release asset - nginx/objs/ngx_http_vhost_traffic_status_module-nginx-${{ matrix.nginx }}.so
if: github.ref == 'refs/heads/master'
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ '/home/runner/work/nginx-module-vts/nginx-module-vts/nginx/objs/ngx_http_vhost_traffic_status_module.so' }}
asset_name: ${{ format('{0}{1}{2}', 'ngx_http_vhost_traffic_status_module-nginx-', matrix.nginx, '.so') }}
asset_content_type: application/octet-stream

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
t/servroot
/.idea/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't include your local editor ignores in the repo. Use git config --global core.excludesFile.

120 changes: 120 additions & 0 deletions configure
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#!/bin/sh

# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.


LC_ALL=C
export LC_ALL

. auto/options
. auto/init
. auto/sources

test -d $NGX_OBJS || mkdir -p $NGX_OBJS

echo > $NGX_AUTO_HEADERS_H
echo > $NGX_AUTOCONF_ERR

echo "#define NGX_CONFIGURE \"$NGX_CONFIGURE\"" > $NGX_AUTO_CONFIG_H


if [ $NGX_DEBUG = YES ]; then
have=NGX_DEBUG . auto/have
fi


if test -z "$NGX_PLATFORM"; then
echo "checking for OS"

NGX_SYSTEM=`uname -s 2>/dev/null`
NGX_RELEASE=`uname -r 2>/dev/null`
NGX_MACHINE=`uname -m 2>/dev/null`

echo " + $NGX_SYSTEM $NGX_RELEASE $NGX_MACHINE"

NGX_PLATFORM="$NGX_SYSTEM:$NGX_RELEASE:$NGX_MACHINE";

case "$NGX_SYSTEM" in
MINGW32_* | MINGW64_* | MSYS_*)
NGX_PLATFORM=win32
;;
esac

else
echo "building for $NGX_PLATFORM"
NGX_SYSTEM=$NGX_PLATFORM
fi

. auto/cc/conf

if [ "$NGX_PLATFORM" != win32 ]; then
. auto/headers
fi

. auto/os/conf

if [ "$NGX_PLATFORM" != win32 ]; then
. auto/unix
fi

. auto/threads
. auto/modules
. auto/lib/conf

case ".$NGX_PREFIX" in
.)
NGX_PREFIX=${NGX_PREFIX:-/usr/local/nginx}
have=NGX_PREFIX value="\"$NGX_PREFIX/\"" . auto/define
;;

.!)
NGX_PREFIX=
;;

*)
have=NGX_PREFIX value="\"$NGX_PREFIX/\"" . auto/define
;;
esac

if [ ".$NGX_CONF_PREFIX" != "." ]; then
have=NGX_CONF_PREFIX value="\"$NGX_CONF_PREFIX/\"" . auto/define
fi

have=NGX_SBIN_PATH value="\"$NGX_SBIN_PATH\"" . auto/define
have=NGX_CONF_PATH value="\"$NGX_CONF_PATH\"" . auto/define
have=NGX_PID_PATH value="\"$NGX_PID_PATH\"" . auto/define
have=NGX_LOCK_PATH value="\"$NGX_LOCK_PATH\"" . auto/define
have=NGX_ERROR_LOG_PATH value="\"$NGX_ERROR_LOG_PATH\"" . auto/define

if [ ".$NGX_ERROR_LOG_PATH" = "." ]; then
have=NGX_ERROR_LOG_STDERR . auto/have
fi

have=NGX_HTTP_LOG_PATH value="\"$NGX_HTTP_LOG_PATH\"" . auto/define
have=NGX_HTTP_CLIENT_TEMP_PATH value="\"$NGX_HTTP_CLIENT_TEMP_PATH\""
. auto/define
have=NGX_HTTP_PROXY_TEMP_PATH value="\"$NGX_HTTP_PROXY_TEMP_PATH\""
. auto/define
have=NGX_HTTP_FASTCGI_TEMP_PATH value="\"$NGX_HTTP_FASTCGI_TEMP_PATH\""
. auto/define
have=NGX_HTTP_UWSGI_TEMP_PATH value="\"$NGX_HTTP_UWSGI_TEMP_PATH\""
. auto/define
have=NGX_HTTP_SCGI_TEMP_PATH value="\"$NGX_HTTP_SCGI_TEMP_PATH\""
. auto/define

. auto/make
. auto/lib/make
. auto/install

# STUB
. auto/stubs

have=NGX_USER value="\"$NGX_USER\"" . auto/define
have=NGX_GROUP value="\"$NGX_GROUP\"" . auto/define

if [ ".$NGX_BUILD" != "." ]; then
have=NGX_BUILD value="\"$NGX_BUILD\"" . auto/define
fi

. auto/summary