You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

66 line
1.9 KiB

  1. name: 'Release'
  2. on:
  3. release:
  4. types: [released]
  5. permissions:
  6. contents: read
  7. env:
  8. GITHUB_TOKEN: ${{ github.token }}
  9. jobs:
  10. build-release-and-publish:
  11. name: 'Build and Publish Assets built for Releases'
  12. runs-on: ubuntu-latest
  13. steps:
  14. - uses: actions/checkout@v3
  15. with:
  16. path: 'frappe'
  17. - uses: actions/setup-node@v3
  18. with:
  19. node-version: 16
  20. - uses: actions/setup-python@v4
  21. with:
  22. python-version: '3.10'
  23. - name: Set up bench and build assets
  24. run: |
  25. npm install -g yarn
  26. pip3 install -U frappe-bench
  27. bench -v init frappe-bench --no-procfile --no-backups --skip-assets --skip-redis-config-generation --python $(which python) --frappe-path $GITHUB_WORKSPACE/frappe
  28. cd frappe-bench && bench build
  29. - name: Package assets
  30. run: |
  31. mkdir -p $GITHUB_WORKSPACE/build
  32. tar -cvpzf $GITHUB_WORKSPACE/build/assets.tar.gz ./frappe-bench/sites/assets/frappe/dist
  33. - name: Get release
  34. id: get_release
  35. uses: bruceadams/get-release@v1.3.1
  36. - name: Upload built Assets to Release
  37. uses: actions/upload-release-asset@v1.0.2
  38. with:
  39. upload_url: ${{ steps.get_release.outputs.upload_url }}
  40. asset_path: build/assets.tar.gz
  41. asset_name: assets.tar.gz
  42. asset_content_type: application/octet-stream
  43. docker-release:
  44. name: 'Trigger Docker build on release'
  45. runs-on: ubuntu-latest
  46. permissions:
  47. contents: none
  48. container:
  49. image: alpine:latest
  50. steps:
  51. - name: curl
  52. run: |
  53. apk add curl bash
  54. curl -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: Bearer ${{ secrets.CI_PAT }}" https://api.github.com/repos/frappe/frappe_docker/actions/workflows/build_stable.yml/dispatches -d '{"ref":"main"}'