Repository navigation
161 lines (139 loc) · 6.03 KB
/
Copy pathsync-dev.yml
File metadata and controls
161 lines (139 loc) · 6.03 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: Weekly wxWidgets Sync
on:
schedule:
- cron: '0 8 * * 6' # Saturday 8am UTC
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: stable
wx_branch: "3.2"
release_tag: "wx-3.2-latest"
always_build: false
mode: full
- name: dev
wx_branch: "master"
release_tag: "wx-dev-latest"
always_build: true
mode: full
- name: interface
wx_branch: "master"
release_tag: "latest-interface"
always_build: true
mode: interface
steps:
- name: Get upstream version
id: upstream
run: |
VERSION=$(curl -sS "https://raw.githubusercontent.com/wxWidgets/wxWidgets/${{ matrix.wx_branch }}/include/wx/version.h" \
| grep -E '#define wx(MAJOR_VERSION|MINOR_VERSION|RELEASE_NUMBER) ' \
| awk '{print $3}' | paste -sd '.')
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Upstream ${{ matrix.name }}: $VERSION"
- name: Check if rebuild needed
id: check
run: |
CURRENT=$(gh release view "${{ matrix.release_tag }}" --json body -q '.body' 2>/dev/null \
| grep -oP 'version=\K[\d.]+' || echo "none")
echo "Published version: $CURRENT"
if [[ "${{ matrix.always_build }}" == "false" && "$CURRENT" == "${{ steps.upstream.outputs.version }}" ]]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
echo "Skipping ${{ matrix.name }}: version $CURRENT unchanged"
else
echo "skip=false" >> "$GITHUB_OUTPUT"
echo "Building ${{ matrix.name }}: $CURRENT -> ${{ steps.upstream.outputs.version }}"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout kwxFetch
if: steps.check.outputs.skip != 'true'
uses: actions/checkout@v6
- name: Setup Python
if: steps.check.outputs.skip != 'true'
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Clone wxWidgets (shallow + submodules)
if: steps.check.outputs.skip != 'true' && matrix.mode == 'full'
run: |
git clone --depth 1 --recurse-submodules --shallow-submodules \
-b ${{ matrix.wx_branch }} \
https://github.com/wxWidgets/wxWidgets.git /tmp/wxWidgets
- name: Clone wxWidgets (shallow, no submodules)
if: steps.check.outputs.skip != 'true' && matrix.mode == 'interface'
run: |
git clone --depth 1 \
-b ${{ matrix.wx_branch }} \
https://github.com/wxWidgets/wxWidgets.git /tmp/wxWidgets
- name: Run sync script
if: steps.check.outputs.skip != 'true' && matrix.mode == 'full'
run: python maintain/sync_wxwidgets.py --source /tmp/wxWidgets --dest .
- name: Run sync script (interface only)
if: steps.check.outputs.skip != 'true' && matrix.mode == 'interface'
run: python maintain/sync_wxwidgets.py --source /tmp/wxWidgets --dest . --interface-only
- name: Install build dependencies
if: steps.check.outputs.skip != 'true' && matrix.mode == 'full'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libgl1-mesa-dev
- name: Configure wxWidgets
if: steps.check.outputs.skip != 'true' && matrix.mode == 'full'
run: |
cmake -B /tmp/wxbuild -S . -G Ninja \
-DwxBUILD_SHARED=OFF \
-DwxBUILD_SAMPLES=OFF \
-DwxBUILD_TESTS=OFF \
-DwxBUILD_DEMOS=OFF \
-DCMAKE_BUILD_TYPE=Release
- name: Build wxWidgets core
if: steps.check.outputs.skip != 'true' && matrix.mode == 'full'
run: ninja -C /tmp/wxbuild wxbase wxcore
- name: Get current date
if: steps.check.outputs.skip != 'true'
id: date
run: echo "today=$(date +%Y-%m-%d)" >> "$GITHUB_OUTPUT"
- name: Create source archive
if: steps.check.outputs.skip != 'true' && matrix.mode == 'full'
run: |
tar -cJf /tmp/kwxFetch-source.tar.xz \
CMakeLists.txt setup.h.in version-script.in \
wx-config-inplace.in wx-config.in \
3rdparty/ art/ build/ include/ src/ utils/
- name: Create interface archive
if: steps.check.outputs.skip != 'true' && matrix.mode == 'interface'
run: |
tar -cJf /tmp/kwxFetch-source.tar.xz interface/
- name: Publish release
if: steps.check.outputs.skip != 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TITLE="wxWidgets ${{ steps.upstream.outputs.version }} (${{ matrix.name }}) — ${{ steps.date.outputs.today }}"
NOTES=$(printf 'version=${{ steps.upstream.outputs.version }}\nSynced from wxWidgets ${{ matrix.wx_branch }} on ${{ steps.date.outputs.today }}.')
TAG="${{ matrix.release_tag }}"
if gh release view "$TAG" > /dev/null 2>&1; then
gh release edit "$TAG" --title "$TITLE" --notes "$NOTES" --prerelease
gh release upload "$TAG" /tmp/kwxFetch-source.tar.xz --clobber
else
gh release create "$TAG" --title "$TITLE" --notes "$NOTES" --prerelease /tmp/kwxFetch-source.tar.xz
fi
# The repository is intentionally static, so GitHub's 60-day inactivity timer
# would auto-disable this scheduled workflow. An empty commit pushed with the
# built-in token counts as repository activity and resets that timer, while
# (unlike GITHUB_TOKEN pushes to branches) it does not trigger further runs.
keepalive:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Reset 60-day inactivity clock
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit --allow-empty -m "chore: weekly activity (keepalive)"
git push