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.
 
 
 
 
 
 

48 line
1.4 KiB

  1. name: 'Frappe Assets'
  2. on:
  3. release:
  4. types: [ created ]
  5. env:
  6. GITHUB_TOKEN: ${{ github.token }}
  7. jobs:
  8. build-release-and-publish:
  9. name: 'Build and Publish Assets built for Releases'
  10. runs-on: ubuntu-latest
  11. steps:
  12. - uses: actions/checkout@v2
  13. with:
  14. path: 'frappe'
  15. - uses: actions/setup-node@v1
  16. with:
  17. python-version: '12.x'
  18. - uses: actions/setup-python@v2
  19. with:
  20. python-version: '3.9'
  21. - name: Set up bench and build assets
  22. run: |
  23. npm install -g yarn
  24. pip3 install -U frappe-bench
  25. bench init frappe-bench --no-procfile --no-backups --skip-assets --skip-redis-config-generation --python $(which python) --frappe-path $GITHUB_WORKSPACE/frappe
  26. cd frappe-bench && bench build
  27. - name: Package assets
  28. run: |
  29. mkdir -p $GITHUB_WORKSPACE/build
  30. tar -cvpzf $GITHUB_WORKSPACE/build/assets.tar.gz ./frappe-bench/sites/assets/frappe/dist
  31. - name: Get release
  32. id: get_release
  33. uses: bruceadams/get-release@v1.2.0
  34. - name: Upload built Assets to Release
  35. uses: actions/upload-release-asset@v1.0.2
  36. with:
  37. upload_url: ${{ steps.get_release.outputs.upload_url }}
  38. asset_path: build/assets.tar.gz
  39. asset_name: assets.tar.gz
  40. asset_content_type: application/octet-stream