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