push.yaml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. name: Push action
  2. on: [push]
  3. jobs:
  4. pre-commit:
  5. runs-on: ubuntu-latest
  6. steps:
  7. - uses: actions/checkout@v4
  8. - name: Add pipx to PATH
  9. run: echo "/root/.local/bin" >> $GITHUB_PATH
  10. - name: Setup cache
  11. uses: actions/cache@v3
  12. with:
  13. path: |
  14. /opt/hostedtoolcache
  15. ~/.local/pipx
  16. /root/.local/bin
  17. key: ${{ runner.os }}-toolcache
  18. - name: Install pre-commit
  19. run: pipx install pre-commit --force
  20. - uses: actions/cache@v3
  21. with:
  22. path: ~/.cache/pre-commit
  23. key: pre-commit-3|${{ env.pythonLocation }}|${{ steps.get-hash-pre-commit.outputs.hash }}
  24. - run: pre-commit run --all-files --show-diff-on-failure --color=always ${{ inputs.extra_args }}
  25. shell: bash
  26. semantic-release:
  27. runs-on: ubuntu-latest
  28. needs:
  29. - pre-commit
  30. if: github.ref == 'refs/heads/main'
  31. steps:
  32. - name: Checkout
  33. uses: actions/checkout@v4
  34. - name: Add pipx to PATH
  35. run: echo "/root/.local/bin" >> $GITHUB_PATH
  36. - uses: actions/setup-node@v4
  37. with:
  38. node-version: "22.9.0"
  39. - name: Setup cache
  40. uses: actions/cache@v3
  41. with:
  42. path: |
  43. ~/.local/pipx
  44. /root/.local/bin
  45. key: ${{ runner.os }}-semantic-release-toolcache
  46. - name: Install poetry
  47. run: pipx install poetry --force
  48. - name: Semantic Release
  49. id: release
  50. uses: https://github.com/cycjimmy/semantic-release-action@v4
  51. with:
  52. extra_plugins: |
  53. @saithodev/semantic-release-gitea
  54. @bjoluc/semantic-release-config-poetry
  55. @semantic-release/git
  56. @semantic-release/changelog
  57. @semantic-release/exec
  58. @google/semantic-release-replace-plugin
  59. prettier
  60. env:
  61. GITEA_URL: ${{ github.server_url }}
  62. GITEA_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}