build.yaml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. name: Release Builds
  2. on:
  3. release:
  4. types: [published]
  5. jobs:
  6. build:
  7. if: "!github.event.release.prerelease"
  8. runs-on: ubuntu-latest
  9. steps:
  10. - uses: actions/checkout@v2
  11. - name: Setup PHP
  12. uses: shivammathur/setup-php@v2
  13. with:
  14. php-version: 7.3
  15. extensions: opcache, gd
  16. coverage: none
  17. env:
  18. COMPOSER_TOKEN: ${{ secrets.GLOBAL_TOKEN }}
  19. - name: Install Dependencies
  20. run: |
  21. sudo apt-get -y update -qq < /dev/null > /dev/null
  22. sudo apt-get -y install -qq git zip < /dev/null > /dev/null
  23. - name: Retrieval of Builder Scripts
  24. run: |
  25. # Real Grav URL
  26. curl --silent -H "Authorization: token ${{ secrets.GLOBAL_TOKEN }}" -H "Accept: application/vnd.github.v3.raw" ${{ secrets.BUILD_SCRIPT_URL }} --output build-grav.sh
  27. # Development Local URL
  28. # curl ${{ secrets.BUILD_SCRIPT_URL }} --output build-grav.sh
  29. - name: Grav Builder
  30. run: |
  31. bash ./build-grav.sh
  32. - name: Upload Grav Release Assets
  33. id: upload-release-asset
  34. uses: alexellis/upload-assets@0.2.3
  35. env:
  36. GITHUB_TOKEN: ${{ secrets.GLOBAL_TOKEN }}
  37. with:
  38. asset_paths: '["./grav-dist/*.zip"]'
  39. slack:
  40. name: Slack
  41. needs: build
  42. runs-on: ubuntu-latest
  43. if: always()
  44. steps:
  45. - uses: technote-space/workflow-conclusion-action@v2
  46. - uses: 8398a7/action-slack@v3
  47. with:
  48. status: failure
  49. fields: repo,message,author,action
  50. icon_emoji: ':octocat:'
  51. author_name: 'Github Action Build'
  52. text: '🚚 Automated Build Failure'
  53. env:
  54. GITHUB_TOKEN: ${{ secrets.GLOBAL_TOKEN }}
  55. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  56. if: env.WORKFLOW_CONCLUSION == 'failure'