release.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. name: "Release"
  2. on:
  3. push:
  4. tags:
  5. - "*"
  6. env:
  7. COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --no-suggest --prefer-dist"
  8. jobs:
  9. build:
  10. name: Upload Release Asset
  11. runs-on: ubuntu-latest
  12. steps:
  13. - name: Checkout code
  14. uses: actions/checkout@v2
  15. - name: "Install PHP"
  16. uses: "shivammathur/setup-php@v2"
  17. with:
  18. coverage: "none"
  19. extensions: "intl"
  20. ini-values: "memory_limit=-1"
  21. php-version: "7.4"
  22. - name: "Install dependencies from composer.lock using composer binary provided by system"
  23. run: "composer install ${{ env.COMPOSER_FLAGS }}"
  24. - name: "Run install again using composer binary from source"
  25. run: "bin/composer install ${{ env.COMPOSER_FLAGS }}"
  26. - name: "Validate composer.json"
  27. run: "bin/composer validate"
  28. - name: Build phar file
  29. run: "php -d phar.readonly=0 bin/compile"
  30. - name: Create release
  31. id: create_release
  32. uses: actions/create-release@v1
  33. env:
  34. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  35. with:
  36. tag_name: ${{ github.ref }}
  37. release_name: ${{ github.ref }}
  38. draft: true
  39. body: TODO
  40. - name: Upload phar
  41. uses: actions/upload-release-asset@v1
  42. env:
  43. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  44. with:
  45. upload_url: ${{ steps.create_release.outputs.upload_url }}
  46. asset_path: ./composer.phar
  47. asset_name: composer.phar
  48. asset_content_type: application/octet-stream