4
4
workflow_dispatch :
5
5
6
6
jobs :
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
+
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
@@ -26,18 +47,17 @@ jobs:
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)
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
39
60
40
- echo "filename=ngx-http-auth-jwt-module-${tag}_libjwt-${{matrix.libjwt-version}}_nginx-${{matrix.nginx-version}}.tgz" >> $GITHUB_OUTPUT
41
61
42
62
# TODO cache the build result so we don't have to do this every time?
43
63
- name : Download jansson
@@ -104,11 +124,14 @@ jobs:
104
124
uses : actions/upload-artifact@v4
105
125
with :
106
126
if-no-files-found : error
107
- name : ${{steps.meta.outputs.filename}}
127
+ name : ${{steps.meta.outputs.artifact}}
128
+ path : ${{steps.meta.outputs.filename}}
108
129
109
130
release :
110
131
name : Create/Update Release
111
- needs : build
132
+ needs :
133
+ - meta
134
+ - build
112
135
runs-on : ubuntu-latest
113
136
permissions :
114
137
contents : write
@@ -119,25 +142,38 @@ jobs:
119
142
run : |
120
143
echo "date_now=$(date --rfc-3339=seconds)" >> "${GITHUB_OUTPUT}"
121
144
122
- - name : Download Build Artifacts
145
+ - name : Download Artifacts
123
146
uses : actions/download-artifact@v4
124
147
with :
125
148
path : artifacts
126
149
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
128
164
uses : ncipollo/release-action@v1
129
165
with :
130
- name : ' Development Build: ${{ github.ref_name }}@${{ github.sha }}'
166
+ tag : ${{needs.meta.outputs.tag}}
167
+ name : " Pre-release: ${{needs.meta.outputs.tag}}"
131
168
body : |
132
169
> [!WARNING]
133
170
> This is an automatically generated pre-release version of the module, which includes the latest master branch changes.
134
171
> Please report any bugs you find.
135
172
136
173
- Build Date: `${{ steps.vars.outputs.date_now }}`
137
- - Commit: ${{ github.sha }}
174
+ - Commit: ` ${{ github.sha }}`
138
175
prerelease : true
139
176
allowUpdates : true
140
177
removeArtifacts : true
141
178
artifactErrorsFailBuild : true
142
179
artifacts : artifacts/*
143
- tag : dev-build
0 commit comments