Skip to content

Commit 9bff960

Browse files
author
Lukas Hutak
committed
CI: improve name of ZIP file with RPM/DEB artifacts
1 parent 96b36b1 commit 9bff960

1 file changed

Lines changed: 20 additions & 13 deletions

File tree

.github/workflows/package.yml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v2
19-
- name: Define global variables
20-
run: echo "::set-output name=zip_file::libfds-${IMAGE//:/}-$GITHUB_SHA.zip"
21-
shell: bash
22-
env:
23-
IMAGE: ${{ matrix.image }}
24-
id: vars
19+
- name: Define variables
20+
uses: actions/github-script@v5
21+
with:
22+
script: |
23+
const sha = context.sha.substring(0, 8);
24+
const image = `${{ matrix.image }}`
25+
const distro = image.split('/').pop().replace(/:/g,'_');
26+
const zip = `libfds-${distro}-${sha}`;
27+
core.exportVariable('ZIP_FILE', zip);
2528
2629
# Dependencies ---------------------------------------------------------------------------
2730
- name: Install dependencies (Ubuntu/Debian)
@@ -42,7 +45,7 @@ jobs:
4245
if: github.event_name == 'push'
4346
uses: actions/upload-artifact@v2
4447
with:
45-
name: ${{ steps.vars.outputs.zip_file }}
48+
name: ${{ env.ZIP_FILE }}
4649
path: |
4750
build/pkg/deb/debbuild/*.deb
4851
build/pkg/deb/debbuild/*.ddeb
@@ -62,11 +65,15 @@ jobs:
6265

6366
steps:
6467
- uses: actions/checkout@v2
65-
- name: Define global variables
66-
run: echo "::set-output name=zip_file::libfds-${IMAGE//:/}-$GITHUB_SHA.zip"
67-
env:
68-
IMAGE: ${{ matrix.image }}
69-
id: vars
68+
- name: Define variables
69+
uses: actions/github-script@v5
70+
with:
71+
script: |
72+
const sha = context.sha.substring(0, 8);
73+
const image = `${{ matrix.image }}`
74+
const distro = image.split('/').pop().replace(/:/g,'_');
75+
const zip = `libfds-${distro}-${sha}`;
76+
core.exportVariable('ZIP_FILE', zip);
7077
7178
# Dependencies ---------------------------------------------------------------------------
7279
- name: Install dependencies (CentOS)
@@ -88,7 +95,7 @@ jobs:
8895
if: github.event_name == 'push'
8996
uses: actions/upload-artifact@v2
9097
with:
91-
name: ${{ steps.vars.outputs.zip_file }}
98+
name: ${{ env.ZIP_FILE }}
9299
path: |
93100
build/pkg/rpm/rpmbuild/RPMS/
94101
build/pkg/rpm/rpmbuild/SRPMS/

0 commit comments

Comments
 (0)