Skip to content

Commit ee8f6a5

Browse files
committed
ci - upload built packages to github release
1 parent 6745503 commit ee8f6a5

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/packages.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,23 @@ jobs:
8585
build/pkg/deb/debbuild/*.ddeb
8686
build/pkg/deb/debbuild/*.tar.gz
8787
build/pkg/deb/debbuild/*.dsc
88+
- name: Publish DEB packages to GitHub releases
89+
if: github.ref == 'refs/heads/master'
90+
env:
91+
GH_TOKEN: ${{ github.token }}
92+
IMAGE_NAME: ${{ matrix.image }}
93+
run: |
94+
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 \
95+
&& tar xzf gh.tar.gz \
96+
&& find gh*/ -name gh -exec mv {} /usr/local/bin/ \;
97+
git config --global --add safe.directory "$PWD" \
98+
&& git tag -f ci-latest HEAD \
99+
&& git push -f origin tag ci-latest
100+
find build/ -iname '*.deb' | while read -r f; do
101+
newf="$IMAGE_NAME-$(basename "$f")"
102+
mv "$f" "$newf"
103+
gh release upload --clobber ci-latest "$newf"
104+
done
88105
89106
rpm:
90107
# Try to build RPM packages
@@ -200,3 +217,20 @@ jobs:
200217
path: |
201218
build/pkg/rpm/rpmbuild/RPMS/
202219
build/pkg/rpm/rpmbuild/SRPMS/
220+
- name: Publish RPM packages to GitHub releases
221+
if: github.ref == 'refs/heads/master'
222+
env:
223+
GH_TOKEN: ${{ github.token }}
224+
IMAGE_NAME: ${{ matrix.image }}
225+
run: |
226+
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 \
227+
&& tar xzf gh.tar.gz \
228+
&& find gh*/ -name gh -exec mv {} /usr/local/bin/ \;
229+
git config --global --add safe.directory "$PWD" \
230+
&& git tag -f ci-latest HEAD \
231+
&& git push -f origin tag ci-latest
232+
find build/ -iname '*.rpm' | while read -r f; do
233+
newf="$IMAGE_NAME-$(basename "$f")"
234+
mv "$f" "$newf"
235+
gh release upload --clobber ci-latest "$newf"
236+
done

0 commit comments

Comments
 (0)