diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6d0bda1142..ecd14f052f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,7 +3,7 @@ name: "[ruff] Release" on: workflow_dispatch: release: - types: [published] + types: [ published ] concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -406,9 +406,6 @@ jobs: run: | pip install --upgrade twine twine upload --skip-existing * - - name: "Update pre-commit mirror" - run: | - curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.RUFF_PRE_COMMIT_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/astral-sh/ruff-pre-commit/dispatches --data '{"event_type": "pypi_release"}' - uses: actions/download-artifact@v3 with: name: binaries @@ -417,3 +414,22 @@ jobs: uses: softprops/action-gh-release@v1 with: files: binaries/* + + # After the release has been published, we update downstream repositories + # This is separate because if this fails the release is still fine, we just need to do some manual workflow triggers + update-dependents: + name: Release + runs-on: ubuntu-latest + needs: release + steps: + - name: "Update pre-commit mirror" + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.RUFF_PRE_COMMIT_PAT }} + script: | + github.rest.actions.createWorkflowDispatch({ + owner: 'astral-sh', + repo: 'ruff-pre-commit', + workflow_id: 'main.yml', + ref: 'main', + })