Skip to content

Commit 462252c

Browse files
committed
Push builds to GitHub releases
1 parent 8b04125 commit 462252c

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

.github/workflows/build.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
- push
44
- repository_dispatch
55
jobs:
6-
package:
6+
build:
77
runs-on: ${{ matrix.operating-system }}
88
strategy:
99
fail-fast: false
@@ -59,6 +59,7 @@ jobs:
5959
run: php -v && php -m
6060

6161
- name: Upload
62+
id: upload
6263
env:
6364
BINTRAY_KEY: ${{ SECRETS.BINTRAY_KEY }}
6465
BINTRAY_USER: shivammathur
@@ -94,4 +95,33 @@ jobs:
9495
curl --user "$BINTRAY_USER":"$BINTRAY_KEY" -T php_"$VERSION"+ubuntu"$DISTRIB_RELEASE".tar.zst https://api.bintray.com/content/shivammathur/php/"$VERSION"-linux/"$VERSION"+ubuntu"$DISTRIB_RELEASE"/php_"$VERSION"+ubuntu"$DISTRIB_RELEASE".tar.zst || true
9596
curl --user "$BINTRAY_USER":"$BINTRAY_KEY" -T php_"$SEMVER"+ubuntu"$DISTRIB_RELEASE".tar.zst https://api.bintray.com/content/shivammathur/php/"$VERSION"-linux/"$VERSION"+ubuntu"$DISTRIB_RELEASE"/php_"$SEMVER"+ubuntu"$DISTRIB_RELEASE".tar.zst || true
9697
curl --user "$BINTRAY_USER":"$BINTRAY_KEY" -X POST https://api.bintray.com/content/"$BINTRAY_USER"/"$BINTRAY_REPO"/"$VERSION"-linux/"$VERSION"+ubuntu"$DISTRIB_RELEASE"/publish || true
97-
fi
98+
fi
99+
mkdir builds
100+
sudo mv *.zst ./builds
101+
- name: Upload Artifact
102+
uses: actions/upload-artifact@v2
103+
with:
104+
name: ${{ matrix.php-versions }}
105+
path: builds
106+
release:
107+
runs-on: ubuntu-latest
108+
needs: build
109+
steps:
110+
- uses: actions/checkout@v2
111+
- run: mkdir builds
112+
- uses: actions/download-artifact@v2
113+
with:
114+
path: builds
115+
- name: Release
116+
run: |
117+
set -x
118+
curl -sLO https://github.com/php-ubuntu/releases/latest/download/install.sh
119+
assets=()
120+
for asset in ./builds/*/*; do
121+
assets+=("-a" "$asset")
122+
done
123+
assets+=("-a" "./install.sh")
124+
version=$(date '+%Y.%m.%d')
125+
hub release create "${assets[@]}" -m "$version" "$version"
126+
env:
127+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)