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
+ 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,22 @@ 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
-
54
+ set -eu
40
55
echo "filename=ngx-http-auth-jwt-module-${tag}_libjwt-${{matrix.libjwt-version}}_nginx-${{matrix.nginx-version}}.tgz" >> $GITHUB_OUTPUT
41
56
57
+
42
58
# TODO cache the build result so we don't have to do this every time?
43
59
- name : Download jansson
44
60
uses : actions/checkout@v4
@@ -104,11 +120,14 @@ jobs:
104
120
uses : actions/upload-artifact@v4
105
121
with :
106
122
if-no-files-found : error
107
- name : ${{steps.meta.outputs.filename}}
123
+ name : release
124
+ path : ${{steps.meta.outputs.filename}}
108
125
109
126
release :
110
127
name : Create/Update Release
111
- needs : build
128
+ needs :
129
+ - meta
130
+ - build
112
131
runs-on : ubuntu-latest
113
132
permissions :
114
133
contents : write
@@ -119,25 +138,38 @@ jobs:
119
138
run : |
120
139
echo "date_now=$(date --rfc-3339=seconds)" >> "${GITHUB_OUTPUT}"
121
140
122
- - name : Download Build Artifacts
141
+ - name : Download Artifacts
123
142
uses : actions/download-artifact@v4
124
143
with :
125
144
path : artifacts
126
145
127
- - name : Upload Builds to Release
146
+ - name : Flatten Artifacts
147
+ run : |
148
+ set -eu
149
+
150
+ cd artifacts
151
+
152
+ for f in $(find . -type f); do
153
+ echo "Staging: ${f}"
154
+ mv "${f}" .
155
+ done
156
+
157
+ find . -type d -mindepth 1 -exec rm -rf "{}" +
158
+
159
+ - name : Create/Update Release
128
160
uses : ncipollo/release-action@v1
129
161
with :
130
- name : ' Development Build: ${{ github.ref_name }}@${{ github.sha }}'
162
+ tag : ${{needs.meta.outputs.tag}}
163
+ name : " Pre-release: ${{ github.ref_name }}@${{ github.sha }}"
131
164
body : |
132
165
> [!WARNING]
133
166
> This is an automatically generated pre-release version of the module, which includes the latest master branch changes.
134
167
> Please report any bugs you find.
135
168
136
169
- Build Date: `${{ steps.vars.outputs.date_now }}`
137
- - Commit: ${{ github.sha }}
170
+ - Commit: ` ${{ github.sha }}`
138
171
prerelease : true
139
172
allowUpdates : true
140
173
removeArtifacts : true
141
174
artifactErrorsFailBuild : true
142
175
artifacts : artifacts/*
143
- tag : dev-build
0 commit comments