@@ -145,7 +145,7 @@ jobs:
145145 gh api \
146146 -X POST \
147147 -H "Accept: application/vnd.github+json" \
148- / repos/${{ github.repository }}/commits/$(git rev-parse HEAD)/comments \
148+ repos/${{ github.repository }}/commits/$(git rev-parse HEAD)/comments \
149149 -f body="$COMMENT_BODY"
150150 else
151151 # Comment on the PR (use provided PR number from !build, or look it up by branch name)
@@ -172,41 +172,16 @@ jobs:
172172 name : graphite-web-bundle
173173 path : frontend/dist
174174
175- - name : 📃 Generate code documentation info for website
175+ - name : 📃 Trigger website rebuild if auto-generated code docs are stale
176176 if : github.event_name == 'push'
177- run : |
178- mkdir -p website/generated-new
179- cargo run -p crate-hierarchy-viz -- website/generated-new/crate_hierarchy.dot
180- cargo run -p editor-message-tree -- website/generated-new/hierarchical_message_system_tree.txt
181-
182- - name : 💿 Obtain cache of auto-generated code docs artifacts, to check if they've changed
183- if : github.event_name == 'push'
184- id : cache-website-code-docs
185- uses : actions/cache/restore@v5
186- with :
187- path : website/generated
188- key : website-code-docs
189-
190- - name : 🔍 Check if auto-generated code docs artifacts changed
191- if : github.event_name == 'push'
192- id : website-code-docs-changed
193- run : |
194- diff --brief --recursive website/generated-new website/generated || echo "changed=true" >> $GITHUB_OUTPUT
195- rm -rf website/generated
196- mv website/generated-new website/generated
197-
198- - name : 💾 Save cache of auto-generated code docs artifacts
199- if : github.event_name == 'push' && steps.website-code-docs-changed.outputs.changed == 'true'
200- uses : actions/cache/save@v5
201- with :
202- path : website/generated
203- key : ${{ steps.cache-website-code-docs.outputs.cache-primary-key }}
204-
205- - name : ♻️ Trigger website rebuild if the auto-generated code docs artifacts have changed
206- if : github.event_name == 'push' && steps.website-code-docs-changed.outputs.changed == 'true'
207177 env :
208178 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
209- run : gh workflow run website.yml --ref master
179+ run : |
180+ cargo run -p editor-message-tree -- website/generated
181+ TREE=volunteer/guide/codebase-overview/hierarchical-message-system-tree
182+ curl -sf "https://graphite.art/$TREE.txt" -o "website/static/$TREE.live.txt" \
183+ && diff -q "website/static/$TREE.txt" "website/static/$TREE.live.txt" > /dev/null \
184+ || gh workflow run website.yml --ref master
210185
211186 windows :
212187 if : github.event_name == 'push' || inputs.windows
@@ -302,16 +277,18 @@ jobs:
302277 env :
303278 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
304279 run : |
305- ARTIFACT_URL=$(gh api /repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts --jq '.artifacts[] | select(.name == "graphite-windows-bundle") | .archive_download_url')
280+ ARTIFACT_ID=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts --jq '.artifacts[] | select(.name == "graphite-windows-bundle") | .id')
281+ ARTIFACT_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/$ARTIFACT_ID"
306282 PR_NUMBER="${{ inputs.pr_number }}"
307283 if [ -z "$PR_NUMBER" ]; then
308284 BRANCH=$(git rev-parse --abbrev-ref HEAD)
309285 PR_NUMBER=$(gh pr list --repo ${{ github.repository }} --head "$BRANCH" --json number --jq '.[0].number' 2>/dev/null || true)
310286 fi
311- if [ -n "$PR_NUMBER" ] && [ -n "$ARTIFACT_URL" ]; then
312- gh pr comment "$PR_NUMBER" --repo ${{ github.repository }} --body "| 📦 **Windows Build Complete for** $(git rev-parse HEAD) |
313- |-|
314- | [Download artifact]($ARTIFACT_URL) |"
287+ if [ -n "$PR_NUMBER" ] && [ -n "$ARTIFACT_ID" ]; then
288+ BODY="| 📦 **Windows Build Complete for** $(git rev-parse HEAD) |"$'\n'
289+ BODY+="|-|"$'\n'
290+ BODY+="| [Download binary]($ARTIFACT_URL) |"
291+ gh pr comment "$PR_NUMBER" --repo ${{ github.repository }} --body "$BODY"
315292 fi
316293
317294 - name : 🔑 Azure login
@@ -488,16 +465,18 @@ jobs:
488465 env :
489466 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
490467 run : |
491- ARTIFACT_URL=$(gh api /repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts --jq '.artifacts[] | select(.name == "graphite-mac-bundle") | .archive_download_url')
468+ ARTIFACT_ID=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts --jq '.artifacts[] | select(.name == "graphite-mac-bundle") | .id')
469+ ARTIFACT_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/$ARTIFACT_ID"
492470 PR_NUMBER="${{ inputs.pr_number }}"
493471 if [ -z "$PR_NUMBER" ]; then
494472 BRANCH=$(git rev-parse --abbrev-ref HEAD)
495473 PR_NUMBER=$(gh pr list --repo ${{ github.repository }} --head "$BRANCH" --json number --jq '.[0].number' 2>/dev/null || true)
496474 fi
497- if [ -n "$PR_NUMBER" ] && [ -n "$ARTIFACT_URL" ]; then
498- gh pr comment "$PR_NUMBER" --repo ${{ github.repository }} --body "| 📦 **Mac Build Complete for** $(git rev-parse HEAD) |
499- |-|
500- | [Download artifact]($ARTIFACT_URL) |"
475+ if [ -n "$PR_NUMBER" ] && [ -n "$ARTIFACT_ID" ]; then
476+ BODY="| 📦 **Mac Build Complete for** $(git rev-parse HEAD) |"$'\n'
477+ BODY+="|-|"$'\n'
478+ BODY+="| [Download binary]($ARTIFACT_URL) |"
479+ gh pr comment "$PR_NUMBER" --repo ${{ github.repository }} --body "$BODY"
501480 fi
502481
503482 - name : 🔏 Sign and notarize (preparation)
@@ -616,20 +595,24 @@ jobs:
616595 compression-level : 0
617596
618597 - name : 💬 Comment artifact link on PR
598+ id : linux-comment
619599 if : github.event_name != 'push'
620600 env :
621601 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
622602 run : |
623- ARTIFACT_URL=$(gh api /repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts --jq '.artifacts[] | select(.name == "graphite-linux-bundle") | .archive_download_url')
603+ ARTIFACT_ID=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts --jq '.artifacts[] | select(.name == "graphite-linux-bundle") | .id')
604+ ARTIFACT_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/$ARTIFACT_ID"
624605 PR_NUMBER="${{ inputs.pr_number }}"
625606 if [ -z "$PR_NUMBER" ]; then
626607 BRANCH=$(git rev-parse --abbrev-ref HEAD)
627608 PR_NUMBER=$(gh pr list --repo ${{ github.repository }} --head "$BRANCH" --json number --jq '.[0].number' 2>/dev/null || true)
628609 fi
629- if [ -n "$PR_NUMBER" ] && [ -n "$ARTIFACT_URL" ]; then
630- gh pr comment "$PR_NUMBER" --repo ${{ github.repository }} --body "| 📦 **Linux Build Complete for** $(git rev-parse HEAD) |
631- |-|
632- | [Download artifact]($ARTIFACT_URL) |"
610+ if [ -n "$PR_NUMBER" ] && [ -n "$ARTIFACT_ID" ]; then
611+ BODY="| 📦 **Linux Build Complete for** $(git rev-parse HEAD) |"$'\n'
612+ BODY+="|-|"$'\n'
613+ BODY+="| [Download binary]($ARTIFACT_URL) |"
614+ COMMENT_ID=$(gh api repos/${{ github.repository }}/issues/$PR_NUMBER/comments -f body="$BODY" --jq '.id')
615+ echo "comment_id=$COMMENT_ID" >> "$GITHUB_OUTPUT"
633616 fi
634617
635618 - name : 🔧 Install Flatpak tooling
@@ -640,7 +623,7 @@ jobs:
640623
641624 - name : 🏗 Build Flatpak
642625 run : |
643- nix build .#graphite-flatpak-manifest
626+ nix build .#graphite${{ inputs.debug && '-dev' || '' }} -flatpak-manifest
644627
645628 rm -rf .flatpak
646629 mkdir -p .flatpak
@@ -660,3 +643,18 @@ jobs:
660643 name : graphite-flatpak
661644 path : .flatpak/Graphite.flatpak
662645 compression-level : 0
646+
647+ - name : 💬 Update PR comment with Flatpak artifact link
648+ if : github.event_name != 'push' && steps.linux-comment.outputs.comment_id
649+ env :
650+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
651+ run : |
652+ ARTIFACT_ID=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts --jq '.artifacts[] | select(.name == "graphite-flatpak") | .id')
653+ ARTIFACT_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/$ARTIFACT_ID"
654+ COMMENT_ID="${{ steps.linux-comment.outputs.comment_id }}"
655+ if [ -n "$ARTIFACT_ID" ]; then
656+ EXISTING_BODY=$(gh api repos/${{ github.repository }}/issues/comments/$COMMENT_ID --jq '.body')
657+ BODY="$EXISTING_BODY"$'\n'
658+ BODY+="| [Download Flatpak]($ARTIFACT_URL) |"
659+ gh api repos/${{ github.repository }}/issues/comments/$COMMENT_ID -X PATCH -f body="$BODY"
660+ fi
0 commit comments