44 workflow_dispatch :
55
66jobs :
7+ meta :
8+ name : Get Metadata
9+ runs-on : ubuntu-latest
10+ outputs :
11+ tag : ${{steps.meta.outputs.tag}}
12+ steps :
13+
14+ - name : Checkout Code
15+ uses : actions/checkout@v4
16+ with :
17+ fetch-depth : 0
18+
19+ - name : Get Metadata
20+ id : meta
21+ run : |
22+ set -eu
23+ tag=$(git describe --tags --abbrev=0)
24+
25+ echo "tag=${tag}" >> $GITHUB_OUTPUT
26+
727 build :
828 name : " NGINX: ${{ matrix.nginx-version }}; libjwt: ${{ matrix.libjwt-version }}"
29+ needs : meta
930 strategy :
1031 matrix :
1132 # NGINX versions to build/test against
12- nginx-version : ['1.20.2', '1.22.1', '1.24.0', '1.26.2', '1.27.3']
33+ nginx-version : ['1.20.2'] # , '1.22.1', '1.24.0', '1.26.2', '1.27.3']
1334
1435 # The following versions of libjwt are compatible:
1536 # * v1.0 - v1.12.0
@@ -19,25 +40,24 @@ jobs:
1940 # * Debian and Ubuntu's repos have v1.10.2
2041 # * EPEL has v1.12.1
2142 # This compiles against each version prior to a breaking change and the latest release
22- libjwt-version : ['1.12.0', '1.14.0', '1.15.3']
43+ libjwt-version : ['1.12.0'] # , '1.14.0', '1.15.3']
2344 runs-on : ubuntu-latest
2445 steps :
2546
2647 - name : Checkout Code
2748 uses : actions/checkout@v4
2849 with :
29- fetch-depth : 0
3050 path : ngx-http-auth-jwt-module
3151
3252 - name : Get Metadata
3353 id : meta
3454 run : |
35- set -eux
36- cd ngx-http-auth-jwt-module
37-
38- tag=$(git describe --tags --abbrev=0)
55+ set -eu
56+ artifact="ngx-http-auth-jwt-module-${{needs.meta.outputs.tag}}_libjwt-${{matrix.libjwt-version}}_nginx-${{matrix.nginx-version}}"
57+
58+ echo "artifact=${artifact}" >> $GITHUB_OUTPUT
59+ echo "filename=artifact.tgz" >> $GITHUB_OUTPUT
3960
40- echo "filename=ngx-http-auth-jwt-module-${tag}_libjwt-${{matrix.libjwt-version}}_nginx-${{matrix.nginx-version}}.tgz" >> $GITHUB_OUTPUT
4161
4262 # TODO cache the build result so we don't have to do this every time?
4363 - name : Download jansson
@@ -104,11 +124,14 @@ jobs:
104124 uses : actions/upload-artifact@v4
105125 with :
106126 if-no-files-found : error
107- name : ${{steps.meta.outputs.filename}}
127+ name : ${{steps.meta.outputs.artifact}}
128+ path : ${{steps.meta.outputs.filename}}
108129
109130 release :
110131 name : Create/Update Release
111- needs : build
132+ needs :
133+ - meta
134+ - build
112135 runs-on : ubuntu-latest
113136 permissions :
114137 contents : write
@@ -119,25 +142,38 @@ jobs:
119142 run : |
120143 echo "date_now=$(date --rfc-3339=seconds)" >> "${GITHUB_OUTPUT}"
121144
122- - name : Download Build Artifacts
145+ - name : Download Artifacts
123146 uses : actions/download-artifact@v4
124147 with :
125148 path : artifacts
126149
127- - name : Upload Builds to Release
150+ - name : Flatten Artifacts
151+ run : |
152+ set -eu
153+
154+ cd artifacts
155+
156+ for f in $(find . -type f); do
157+ echo "Staging: ${f}"
158+ mv "${f}" .
159+ done
160+
161+ find . -type d -mindepth 1 -exec rm -rf "{}" +
162+
163+ - name : Create/Update Release
128164 uses : ncipollo/release-action@v1
129165 with :
130- name : ' Development Build: ${{ github.ref_name }}@${{ github.sha }}'
166+ tag : ${{needs.meta.outputs.tag}}
167+ name : " Pre-release: ${{needs.meta.outputs.tag}}"
131168 body : |
132169 > [!WARNING]
133170 > This is an automatically generated pre-release version of the module, which includes the latest master branch changes.
134171 > Please report any bugs you find.
135172
136173 - Build Date: `${{ steps.vars.outputs.date_now }}`
137- - Commit: ${{ github.sha }}
174+ - Commit: ` ${{ github.sha }}`
138175 prerelease : true
139176 allowUpdates : true
140177 removeArtifacts : true
141178 artifactErrorsFailBuild : true
142179 artifacts : artifacts/*
143- tag : dev-build
0 commit comments