Skip to content

Commit

Permalink
Push builds to GitHub releases
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Oct 26, 2020
1 parent 8b04125 commit 462252c
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
- push
- repository_dispatch
jobs:
package:
build:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -59,6 +59,7 @@ jobs:
run: php -v && php -m

- name: Upload
id: upload
env:
BINTRAY_KEY: ${{ SECRETS.BINTRAY_KEY }}
BINTRAY_USER: shivammathur
Expand Down Expand Up @@ -94,4 +95,33 @@ jobs:
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
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
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
fi
fi
mkdir builds
sudo mv *.zst ./builds
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.php-versions }}
path: builds
release:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- run: mkdir builds
- uses: actions/download-artifact@v2
with:
path: builds
- name: Release
run: |
set -x
curl -sLO https://github.com/php-ubuntu/releases/latest/download/install.sh
assets=()
for asset in ./builds/*/*; do
assets+=("-a" "$asset")
done
assets+=("-a" "./install.sh")
version=$(date '+%Y.%m.%d')
hub release create "${assets[@]}" -m "$version" "$version"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 462252c

Please sign in to comment.