Skip to content

Commit dbcf0fd

Browse files
author
Lukas Hutak
committed
CI: improve name of ZIP file with RPM/DEB artifacts
1 parent 4d75aba commit dbcf0fd

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

.github/workflows/packages.yml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,18 @@ jobs:
2323

2424
steps:
2525
- uses: actions/checkout@v2
26-
- name: Define global variables
27-
run: echo "::set-output name=zip_file::ipfixcol2-${IMAGE//:/}-$GITHUB_SHA.zip"
28-
shell: bash
29-
env:
30-
IMAGE: ${{ matrix.image }}
31-
id: vars
26+
- name: Define variables
27+
uses: actions/github-script@v5
28+
with:
29+
script: |
30+
const sha = context.sha.substring(0, 8);
31+
const image = `${{ matrix.image }}`
32+
const distro = image.split('/').pop().replace(/:/g,'_');
33+
const zip = `ipfixcol2-${distro}-${sha}`;
34+
core.exportVariable('ZIP_FILE', zip);
35+
- name: Prepare environment
36+
run: |
37+
mkdir -p build/libfds_repo
3238
3339
# Dependencies ---------------------------------------------------------------------------
3440
- name: Install dependencies for libfds and IPFIXcol2 (Ubuntu/Debian)
@@ -71,7 +77,7 @@ jobs:
7177
if: github.event_name == 'push'
7278
uses: actions/upload-artifact@v2
7379
with:
74-
name: ${{ steps.vars.outputs.zip_file }}
80+
name: ${{ env.ZIP_FILE }}
7581
path: |
7682
build/pkg/deb/debbuild/*.deb
7783
build/pkg/deb/debbuild/*.ddeb
@@ -91,13 +97,18 @@ jobs:
9197

9298
steps:
9399
- uses: actions/checkout@v2
94-
- name: Prepare environment and variables
100+
- name: Define variables
101+
uses: actions/github-script@v5
102+
with:
103+
script: |
104+
const sha = context.sha.substring(0, 8);
105+
const image = `${{ matrix.image }}`
106+
const distro = image.split('/').pop().replace(/:/g,'_');
107+
const zip = `ipfixcol2-${distro}-${sha}`;
108+
core.exportVariable('ZIP_FILE', zip);
109+
- name: Prepare environment
95110
run: |
96-
echo "::set-output name=zip_file::ipfixcol2-${IMAGE//:/}-$GITHUB_SHA.zip"
97111
mkdir -p build/libfds_repo
98-
env:
99-
IMAGE: ${{ matrix.image }}
100-
id: vars
101112
102113
# Dependencies ---------------------------------------------------------------------------
103114
- name: Enable additional repositories (CentOS 8)
@@ -149,7 +160,7 @@ jobs:
149160
if: github.event_name == 'push'
150161
uses: actions/upload-artifact@v2
151162
with:
152-
name: ${{ steps.vars.outputs.zip_file }}
163+
name: ${{ env.ZIP_FILE }}
153164
path: |
154165
build/pkg/rpm/rpmbuild/RPMS/
155166
build/pkg/rpm/rpmbuild/SRPMS/

0 commit comments

Comments
 (0)