Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions .github/workflows/generate-references.yml

This file was deleted.

30 changes: 26 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ jobs:
environment: "Release" # This will require an approval from a maintainer, they are notified in Slack above
permissions:
contents: write
actions: write
id-token: write
steps:
- name: Notify Slack - Approved
Expand Down Expand Up @@ -194,11 +193,34 @@ jobs:
NEW_VERSION: ${{ steps.sampo-release.outputs.new_version }}
run: gh release create "$NEW_VERSION" --generate-notes

- name: Dispatch generate-references
- name: Generate references
if: steps.commit-release.outputs.commit-hash != ''
run: |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a continue on error for these next steps? Low context from me here but if the package is released and externally visible I think we should not fail. Plus previous impl was just dispatching to another workflow so any failures were isolated there and did not affect this one

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont disagree but this is exactly what happened before
generate references was failing and we didnt notice for quite a while

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be a warning message on slack?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is executed after release, github release etc the release will work anyway, and if references failed, we can just fix forward

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, its gonna be a failed release, so the slack thread gets updated, we know that it partly failed, fix forward and thats it

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can change if this often fails and its breaking releases
we tried the other way, we had this broken for a few weeks, now we try the other way

uv run bin/docs generate-references

- name: Check for changes in references
if: steps.commit-release.outputs.commit-hash != ''
id: references-changes
run: |
if [ -n "$(git status --porcelain references/)" ]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
echo "New references generated in references directory:"
git status --porcelain references/
else
echo "changed=false" >> "$GITHUB_OUTPUT"
echo "No new references generated in references directory"
fi

- name: Commit generated references
if: steps.commit-release.outputs.commit-hash != '' && steps.references-changes.outputs.changed == 'true'
uses: planetscale/ghcommit-action@25309d8005ac7c3bcd61d3fe19b69e0fe47dbdde # v0.2.20
with:
commit_message: "Update generated references"
repo: ${{ github.repository }}
branch: main
file_pattern: references/
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh workflow run generate-references.yml --ref main
GITHUB_TOKEN: ${{ steps.releaser.outputs.token }}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need this to live here because of the GH token, otherwise it'd require a 2nd environment approval


# Notify in case of a failure
- name: Send failure event to PostHog
Expand Down
Loading