Skip to content

Commit f6760ca

Browse files
committed
Push builds to GitHub releases
1 parent a82c0c0 commit f6760ca

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
php$ver -r "echo file_get_contents('https://repo.packagist.org/packages.json');"
3434
env:
3535
ver: ${{ matrix.php-versions }}
36-
release:
36+
build:
3737
name: Update dist
3838
needs: test
3939
runs-on: ubuntu-latest
@@ -45,6 +45,7 @@ jobs:
4545
curl -sSLO http://archive.ubuntu.com/ubuntu/pool/universe/libz/libzstd/zstd_1.4.4+dfsg-3_amd64.deb
4646
sudo DEBIAN_FRONTEND=noninteractive dpkg -i --force-conflicts zstd_1.4.4+dfsg-3_amd64.deb
4747
zstd -V
48+
mkdir builds
4849
for v in 5.3 5.4 5.5; do
4950
sudo XZ_OPT=-0 tar cfJ php-$v.tar.xz php-$v
5051
sudo tar cf - php-$v | zstd --fast=7 > php-$v.tar.zst
@@ -53,8 +54,37 @@ jobs:
5354
curl --user "$BINTRAY_USER":"$BINTRAY_KEY" -T php-$v.tar.xz https://api.bintray.com/content/shivammathur/php/"$v"-linux/"$v"/php-$v.tar.xz || true
5455
curl --user "$BINTRAY_USER":"$BINTRAY_KEY" -T php-$v.tar.zst https://api.bintray.com/content/shivammathur/php/"$v"-linux/"$v"/php-$v.tar.zst || true
5556
curl --user "$BINTRAY_USER":"$BINTRAY_KEY" -X POST https://api.bintray.com/content/"$BINTRAY_USER"/"$BINTRAY_REPO"/"$v"-linux/"$v"/publish || true
57+
mv php-$v.tar.* ./builds/
5658
done
5759
env:
5860
BINTRAY_KEY: ${{ secrets.bintray_key }}
5961
BINTRAY_USER: shivammathur
6062
BINTRAY_REPO: php
63+
- name: Upload Artifact
64+
uses: actions/upload-artifact@v2
65+
with:
66+
name: builds
67+
path: builds
68+
release:
69+
runs-on: ubuntu-latest
70+
needs: build
71+
steps:
72+
- uses: actions/checkout@v2
73+
- run: mkdir builds
74+
- uses: actions/download-artifact@v2
75+
with:
76+
path: builds
77+
- name: Release
78+
run: |
79+
set -x
80+
curl -sLO https://github.com/shivammathur/php5-ubuntu/releases/latest/download/install.sh
81+
assets=()
82+
for asset in ./builds/*/*; do
83+
assets+=("-a" "$asset")
84+
done
85+
assets+=("-a" "./install.sh")
86+
git push -f origin :builds || true
87+
hub release delete "builds" || true
88+
hub release create "${assets[@]}" -m "builds" "builds"
89+
env:
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)