publish-main.yml 874 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ---
  2. name: Publish main branch
  3. "on":
  4. push:
  5. branches:
  6. - master
  7. workflow_dispatch:
  8. jobs:
  9. publish-main:
  10. runs-on: ubuntu-latest
  11. permissions:
  12. contents: write
  13. steps:
  14. - name: Checkout repository
  15. uses: actions/checkout@v5
  16. with:
  17. fetch-depth: 0 # Fetch all history
  18. - name: Set up Python
  19. uses: actions/setup-python@v6
  20. with:
  21. python-version: '3.x'
  22. - name: Install dulwich
  23. run: |
  24. pip install -e .
  25. - name: Delete existing main branch if present
  26. run: |
  27. if git show-ref --verify refs/heads/main; then
  28. git branch -D main
  29. fi
  30. - name: Run fix-history script
  31. run: |
  32. python devscripts/fix-history.py master main
  33. - name: Push main branch
  34. run: |
  35. git push origin main --force