publish-main.yml 901 B

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