Skip to content

Commit a9e5d34

Browse files
authored
[CI/CD] Fix debian package naming (#1153)
1 parent 4e44ae5 commit a9e5d34

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

.github/workflows/upload-release-assets.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,23 @@ jobs:
6464
echo "${{secrets.PUBTEST_CERT}}" > pubtest.crt
6565
echo "${{secrets.PUBTEST_KEY}}" > pubtest.key
6666
PKG_REPO=${{inputs.pkgRepo}} CERT=pubtest.crt KEY=pubtest.key DL=1 scripts/packages/package-check.sh ${{inputs.pkgVersion}}
67+
for i in $(find ${{inputs.pkgRepo}}/nginx-agent | grep -e "nginx-agent[_-]${{inputs.pkgVersion}}"); do
68+
if [[ "$i" == *.deb ]]; then
69+
echo "Renaming ${i} to ${i/_/-}"
70+
mv "${i}" "${i/_/-}"
71+
fi
72+
if [[ "$i" == *.apk ]]; then
73+
ver=$(echo "$i" | grep -o -e "v[0-9]*\.[0-9]*")
74+
arch=$(echo "$i" | grep -o -F -e "x86_64" -e "aarch64")
75+
dest="$(dirname "$i")/nginx-agent-${{inputs.pkgVersion}}-$ver-$arch.apk"
76+
echo "Renaming ${i} to ${dest}"
77+
mv "${i}" "${dest}"
78+
fi
79+
done
6780
find ${{inputs.pkgRepo}}/nginx-agent | grep -e "nginx-agent[_-]${{inputs.pkgVersion}}"
6881

6982
- name: GitHub Upload
83+
continue-on-error: true
7084
if: ${{ needs.vars.outputs.github_release == 'true' }}
7185
env:
7286
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -88,11 +102,6 @@ jobs:
88102
inlineScript: |
89103
for i in $(find ${{inputs.pkgRepo}}/nginx-agent | grep -e "nginx-agent[_-]${{inputs.pkgVersion}}"); do
90104
dest="nginx-agent/${GITHUB_REF##*/}/${i##*/}"
91-
if [[ "$i" == *.apk ]]; then
92-
ver=$(echo "$i" | grep -o -e "v[0-9]*\.[0-9]*")
93-
arch=$(echo "$i" | grep -o -F -e "x86_64" -e "aarch64")
94-
dest="nginx-agent/${GITHUB_REF##*/}/nginx-agent-$VER-$ver-$arch.apk"
95-
fi
96105
echo "Uploading ${i} to ${dest}"
97106
az storage blob upload --auth-mode=login -f "$i" -c ${{ secrets.AZURE_CONTAINER_NAME }} \
98107
--account-name ${{ secrets.AZURE_ACCOUNT_NAME }} --overwrite -n ${dest}

0 commit comments

Comments
 (0)