deploy.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. name: deploy
  2. on:
  3. release:
  4. types: published
  5. jobs:
  6. homebrew-entt:
  7. timeout-minutes: 5
  8. runs-on: ubuntu-latest
  9. env:
  10. GH_REPO: homebrew-entt
  11. FORMULA: entt.rb
  12. steps:
  13. - uses: actions/checkout@v2
  14. - name: Clone repository
  15. working-directory: build
  16. env:
  17. PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
  18. run: |
  19. git clone https://$GITHUB_ACTOR:$PERSONAL_ACCESS_TOKEN@github.com/$GITHUB_ACTOR/$GH_REPO.git
  20. - name: Prepare formula
  21. working-directory: build
  22. run: |
  23. cd $GH_REPO
  24. curl "https://github.com/${{ github.repository }}/archive/${{ github.ref }}.tar.gz" --location --fail --silent --show-error --output archive.tar.gz
  25. sed -i -e '/url/s/".*"/"'$(echo "https://github.com/${{ github.repository }}/archive/${{ github.ref }}.tar.gz" | sed -e 's/[\/&]/\\&/g')'"/' $FORMULA
  26. sed -i -e '/sha256/s/".*"/"'$(openssl sha256 archive.tar.gz | cut -d " " -f 2)'"/' $FORMULA
  27. - name: Update remote
  28. working-directory: build
  29. run: |
  30. cd $GH_REPO
  31. git config --local user.email "action@github.com"
  32. git config --local user.name "$GITHUB_ACTOR"
  33. git add $FORMULA
  34. git commit -m "Update to ${{ github.ref }}"
  35. git push origin master