4
4
workflow_dispatch :
5
5
6
6
jobs :
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
+
7
27
build :
8
28
name : " NGINX: ${{ matrix.nginx-version }}; libjwt: ${{ matrix.libjwt-version }}"
29
+ needs : meta
9
30
strategy :
10
31
matrix :
11
32
# 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']
13
34
14
35
# The following versions of libjwt are compatible:
15
36
# * v1.0 - v1.12.0
@@ -19,26 +40,22 @@ jobs:
19
40
# * Debian and Ubuntu's repos have v1.10.2
20
41
# * EPEL has v1.12.1
21
42
# 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']
23
44
runs-on : ubuntu-latest
24
45
steps :
25
46
26
47
- name : Checkout Code
27
48
uses : actions/checkout@v4
28
49
with :
29
- fetch-depth : 0
30
50
path : ngx-http-auth-jwt-module
31
51
32
52
- name : Get Metadata
33
53
id : meta
34
54
run : |
35
- set -eux
36
- cd ngx-http-auth-jwt-module
37
-
38
- tag=$(git describe --tags --abbrev=0)
39
-
55
+ set -eu
40
56
echo "filename=ngx-http-auth-jwt-module-${tag}_libjwt-${{matrix.libjwt-version}}_nginx-${{matrix.nginx-version}}.tgz" >> $GITHUB_OUTPUT
41
57
58
+
42
59
# TODO cache the build result so we don't have to do this every time?
43
60
- name : Download jansson
44
61
uses : actions/checkout@v4
@@ -104,11 +121,14 @@ jobs:
104
121
uses : actions/upload-artifact@v4
105
122
with :
106
123
if-no-files-found : error
107
- name : ${{steps.meta.outputs.filename}}
124
+ name : release
125
+ path : ${{steps.meta.outputs.filename}}
108
126
109
127
release :
110
128
name : Create/Update Release
111
- needs : build
129
+ needs :
130
+ - meta
131
+ - build
112
132
runs-on : ubuntu-latest
113
133
permissions :
114
134
contents : write
@@ -119,25 +139,38 @@ jobs:
119
139
run : |
120
140
echo "date_now=$(date --rfc-3339=seconds)" >> "${GITHUB_OUTPUT}"
121
141
122
- - name : Download Build Artifacts
142
+ - name : Download Artifacts
123
143
uses : actions/download-artifact@v4
124
144
with :
125
145
path : artifacts
126
146
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
128
161
uses : ncipollo/release-action@v1
129
162
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 }}"
131
165
body : |
132
166
> [!WARNING]
133
167
> This is an automatically generated pre-release version of the module, which includes the latest master branch changes.
134
168
> Please report any bugs you find.
135
169
136
170
- Build Date: `${{ steps.vars.outputs.date_now }}`
137
- - Commit: ${{ github.sha }}
171
+ - Commit: ` ${{ github.sha }}`
138
172
prerelease : true
139
173
allowUpdates : true
140
174
removeArtifacts : true
141
175
artifactErrorsFailBuild : true
142
176
artifacts : artifacts/*
143
- tag : dev-build
0 commit comments