Skip to content

Commit 5c8ae38

Browse files
committed
...
1 parent 4fcaf73 commit 5c8ae38

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/packages.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,26 @@ jobs:
8383
build/pkg/deb/debbuild/*.ddeb
8484
build/pkg/deb/debbuild/*.tar.gz
8585
build/pkg/deb/debbuild/*.dsc
86+
- name: Publish DEB packages to GitHub releases
87+
if: github.ref == 'refs/heads/master'
88+
env:
89+
GH_TOKEN: ${{ github.token }}
90+
IMAGE_NAME: ${{ matrix.image }}
91+
run: |
92+
set -x
93+
pwd
94+
ls
95+
curl -sL "$(curl -sL "https://api.github.com/repos/cli/cli/releases" | grep _linux_amd64.tar.gz | grep https | head -n1 | cut -d'"' -f4)" -o gh.tar.gz \
96+
&& tar xzf gh.tar.gz \
97+
&& find gh*/ -name gh -exec mv {} /usr/local/bin/ \;
98+
git config --global --add safe.directory "$PWD" \
99+
&& git tag -f ci-latest HEAD \
100+
&& git push -f origin tag ci-latest
101+
find build/pkg/ -iname '*.deb' | while read -r f; do
102+
newf="$IMAGE_NAME-$(basename "$f")"
103+
mv "$f" "$newf"
104+
gh release upload --clobber ci-latest "$newf"
105+
done
86106
87107
rpm:
88108
# Try to build RPM packages
@@ -185,3 +205,20 @@ jobs:
185205
path: |
186206
build/pkg/rpm/rpmbuild/RPMS/
187207
build/pkg/rpm/rpmbuild/SRPMS/
208+
- name: Publish RPM packages to GitHub releases
209+
if: github.ref == 'refs/heads/master'
210+
env:
211+
GH_TOKEN: ${{ github.token }}
212+
IMAGE_NAME: ${{ matrix.image }}
213+
run: |
214+
curl -sL "$(curl -sL "https://api.github.com/repos/cli/cli/releases" | grep _linux_amd64.tar.gz | grep https | head -n1 | cut -d'"' -f4)" -o gh.tar.gz \
215+
&& tar xzf gh.tar.gz \
216+
&& find gh*/ -name gh -exec mv {} /usr/local/bin/ \;
217+
git config --global --add safe.directory "$PWD" \
218+
&& git tag -f ci-latest HEAD \
219+
&& git push -f origin tag ci-latest
220+
find build/pkg/ -iname '*.rpm' | while read -r f; do
221+
newf="$IMAGE_NAME-$(basename "$f")"
222+
mv "$f" "$newf"
223+
gh release upload --clobber ci-latest "$newf"
224+
done

0 commit comments

Comments
 (0)