Skip to content

Commit a2e3e91

Browse files
fix artifact processing in workflow
1 parent acbb12e commit a2e3e91

16 files changed

+49
-1026
lines changed

.github/workflows/make-releases.yml

Lines changed: 49 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,29 @@ on:
44
workflow_dispatch:
55

66
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+
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
@@ -26,18 +47,17 @@ jobs:
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)
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
3960
40-
echo "filename=ngx-http-auth-jwt-module-${tag}_libjwt-${{matrix.libjwt-version}}_nginx-${{matrix.nginx-version}}.tgz" >> $GITHUB_OUTPUT
4161
4262
# TODO cache the build result so we don't have to do this every time?
4363
- name: Download jansson
@@ -104,11 +124,14 @@ jobs:
104124
uses: actions/upload-artifact@v4
105125
with:
106126
if-no-files-found: error
107-
name: ${{steps.meta.outputs.filename}}
127+
name: ${{steps.meta.outputs.artifact}}
128+
path: ${{steps.meta.outputs.filename}}
108129

109130
release:
110131
name: Create/Update Release
111-
needs: build
132+
needs:
133+
- meta
134+
- build
112135
runs-on: ubuntu-latest
113136
permissions:
114137
contents: write
@@ -119,25 +142,38 @@ jobs:
119142
run: |
120143
echo "date_now=$(date --rfc-3339=seconds)" >> "${GITHUB_OUTPUT}"
121144
122-
- name: Download Build Artifacts
145+
- name: Download Artifacts
123146
uses: actions/download-artifact@v4
124147
with:
125148
path: artifacts
126149

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
128164
uses: ncipollo/release-action@v1
129165
with:
130-
name: 'Development Build: ${{ github.ref_name }}@${{ github.sha }}'
166+
tag: ${{needs.meta.outputs.tag}}
167+
name: "Pre-release: ${{needs.meta.outputs.tag}}"
131168
body: |
132169
> [!WARNING]
133170
> This is an automatically generated pre-release version of the module, which includes the latest master branch changes.
134171
> Please report any bugs you find.
135172
136173
- Build Date: `${{ steps.vars.outputs.date_now }}`
137-
- Commit: ${{ github.sha }}
174+
- Commit: `${{ github.sha }}`
138175
prerelease: true
139176
allowUpdates: true
140177
removeArtifacts: true
141178
artifactErrorsFailBuild: true
142179
artifacts: artifacts/*
143-
tag: dev-build

test/docker-compose-test.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

test/ec_key_256.pem

Lines changed: 0 additions & 5 deletions
This file was deleted.

test/ec_key_384.pem

Lines changed: 0 additions & 6 deletions
This file was deleted.

test/ec_key_521.pem

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)