-
Notifications
You must be signed in to change notification settings - Fork 1
115 lines (95 loc) · 3.78 KB
/
sync-upstream.yml
File metadata and controls
115 lines (95 loc) · 3.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: sync-upstream
on:
workflow_dispatch:
permissions:
contents: write
pull-requests: write
concurrency:
group: sync-upstream
cancel-in-progress: false
env:
LANG: C.UTF-8
LC_ALL: C.UTF-8
NO_COLOR: '1'
FORCE_COLOR: '0'
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22.14.0'
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.13'
- name: Refresh upstream pin
id: sync
run: node ./scripts/sync-upstream.mjs --write
- name: Stop early when nothing changed
id: diff
run: |
if git diff --quiet -- upstream-gstack.json; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run tests
if: steps.diff.outputs.changed == 'true'
run: bun test
- name: Build release artifacts smoke
if: steps.diff.outputs.changed == 'true'
env:
GSTACK_CODEX_UPSTREAM_ROOT: ${{ github.workspace }}/dist/.sync-upstream/gstack
run: node ./scripts/build-release-artifacts.mjs
- name: Pack npm artifact smoke
if: steps.diff.outputs.changed == 'true'
env:
GSTACK_CODEX_UPSTREAM_ROOT: ${{ github.workspace }}/dist/.sync-upstream/gstack
run: node ./scripts/pack-release.mjs
- name: Run release compatibility gate
if: steps.diff.outputs.changed == 'true'
run: npm run check:release
- name: Generate upstream diff report
if: steps.diff.outputs.changed == 'true'
id: report
env:
GSTACK_CODEX_UPSTREAM_ROOT: ${{ github.workspace }}/dist/.sync-upstream/gstack
run: |
node ./scripts/report-upstream-diff.mjs \
--previous "${{ steps.sync.outputs.previous_commit }}" \
--current "${{ steps.sync.outputs.pinned_commit }}" \
--output "${{ github.workspace }}/dist/upstream-diff-report.md"
- name: Upload upstream diff report
if: steps.diff.outputs.changed == 'true'
uses: actions/upload-artifact@v4
with:
name: upstream-diff-report
path: dist/upstream-diff-report.md
- name: Create pull request
if: steps.diff.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v7
with:
branch: chore/sync-upstream-gstack
commit-message: 'chore: sync upstream gstack'
title: 'chore: sync upstream gstack'
body: |
Updates `upstream-gstack.json` to the latest upstream `garrytan/gstack` commit.
Upstream:
- Previous: `${{ steps.sync.outputs.previous_version }}` / `${{ steps.sync.outputs.previous_commit }}`
- Next: `${{ steps.sync.outputs.pinned_version }}` / `${{ steps.sync.outputs.pinned_commit }}`
- Compare: ${{ steps.sync.outputs.compare_url }}
- Commits: `${{ steps.report.outputs.commits }}`
- Files changed: `${{ steps.report.outputs.files_changed }}`
- File categories: `${{ steps.report.outputs.categories }}`
This repository does not vendor the generated upstream bundle into `main`.
Release builds recreate the bundle from this tracked pin and include it in
the npm tarball under `bundle/current`.
This workflow ran tests, built release artifacts, packed the npm
artifact, and ran the release compatibility gate before opening the PR.
The full upstream diff report is attached to the workflow run as
`upstream-diff-report`.
This PR was generated by `sync-upstream.yml`.