44 workflow_dispatch :
55
66jobs :
7+ meta :
8+ runs-on : ubuntu-latest
9+ outputs :
10+ tag : ${{steps.meta.outputs.tag}}
11+ steps :
12+
13+ - name : Checkout Code
14+ uses : actions/checkout@v4
15+ with :
16+ fetch-depth : 0
17+
18+ - name : GetMetadata
19+ id : meta
20+ working-directory : ngx-http-auth-jwt-module
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,26 +40,22 @@ 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)
39-
55+ set -eu
4056 echo "filename=ngx-http-auth-jwt-module-${tag}_libjwt-${{matrix.libjwt-version}}_nginx-${{matrix.nginx-version}}.tgz" >> $GITHUB_OUTPUT
4157
58+
4259 # TODO cache the build result so we don't have to do this every time?
4360 - name : Download jansson
4461 uses : actions/checkout@v4
@@ -104,11 +121,14 @@ jobs:
104121 uses : actions/upload-artifact@v4
105122 with :
106123 if-no-files-found : error
107- name : ${{steps.meta.outputs.filename}}
124+ name : release
125+ path : ${{steps.meta.outputs.filename}}
108126
109127 release :
110128 name : Create/Update Release
111- needs : build
129+ needs :
130+ - meta
131+ - build
112132 runs-on : ubuntu-latest
113133 permissions :
114134 contents : write
@@ -119,25 +139,38 @@ jobs:
119139 run : |
120140 echo "date_now=$(date --rfc-3339=seconds)" >> "${GITHUB_OUTPUT}"
121141
122- - name : Download Build Artifacts
142+ - name : Download Artifacts
123143 uses : actions/download-artifact@v4
124144 with :
125145 path : artifacts
126146
127- - name : Upload Builds to Release
147+ - name : Flatten Artifacts
148+ run : |
149+ set -eu
150+
151+ cd artifacts
152+
153+ for f in $(find . -type f); do
154+ echo "Staging: ${f}"
155+ mv "${f}" .
156+ done
157+
158+ find . -type d -mindepth 1 -exec rm -rf "{}" +
159+
160+ - name : Create/Update Release
128161 uses : ncipollo/release-action@v1
129162 with :
130- name : ' Development Build: ${{ github.ref_name }}@${{ github.sha }}'
163+ tag : ${{needs.meta.outputs.tag}}
164+ name : " Pre-release: ${{ github.ref_name }}@${{ github.sha }}"
131165 body : |
132166 > [!WARNING]
133167 > This is an automatically generated pre-release version of the module, which includes the latest master branch changes.
134168 > Please report any bugs you find.
135169
136170 - Build Date: `${{ steps.vars.outputs.date_now }}`
137- - Commit: ${{ github.sha }}
171+ - Commit: ` ${{ github.sha }}`
138172 prerelease : true
139173 allowUpdates : true
140174 removeArtifacts : true
141175 artifactErrorsFailBuild : true
142176 artifacts : artifacts/*
143- tag : dev-build
0 commit comments