Repository navigation
251 lines (222 loc) 路 6.88 KB
/
Copy pathci.yaml
File metadata and controls
251 lines (222 loc) 路 6.88 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
name: Build
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
tag:
description: "Release tag: <major>.<minor>.<patch> or <major>.<minor>.<patch>+<n>, optional 'v' prefix (defaults to v<VERSION>)"
required: false
type: string
publish:
description: "Publish the GitHub release for the resolved tag"
required: false
default: false
type: boolean
push:
branches: [main]
paths: ["VERSION"]
pull_request:
paths-ignore:
- "**/*.md"
- "**/VERSION"
types: [opened, synchronize, reopened]
release:
types: [published]
jobs:
build_appimage:
permissions:
actions: read
security-events: write
contents: write
name: 馃懟 Build Ghostty (${{ matrix.arch }})
runs-on: ${{ matrix.runs-on }}
strategy:
matrix:
include:
- arch: aarch64
platform: linux/arm64
runs-on: ubuntu-24.04-arm
- arch: x86_64
platform: linux/amd64
runs-on: ubuntu-24.04
container:
image: ghcr.io/pkgforge-dev/archlinux:latest
steps:
- name: Checkout ghostty-appimage
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Preparing Container
uses: pkgforge-dev/anylinux-setup-action@b2d1ce4216f71162e00ae58fa11ee9aeb723d0d5 # v5
- name: Cache dependencies
id: cache-ghostty
uses: actions/cache@v6
with:
path: |
/var/cache/pacman
/tmp/offline-cache
/root/.cache/zig
key: ${{ runner.os }}-${{ matrix.arch }}-ghostty-${{ hashFiles('**/VERSION') }}
restore-keys: |
${{ runner.os }}-${{ matrix.arch }}-ghostty-
- name: Use tip version
if: ${{ github.event_name == 'schedule' }}
run: ./bin/repo-management.sh tip-version
- name: Setup build environment
run: ./bin/setup-env.sh
- name: Build Ghostty
run: |
./bin/build-ghostty.sh
- name: Bundle AppImage
run: |
./bin/bundle-appimage.sh
- name: Validate AppImage
run: ./bin/repo-management.sh validate-appimage
- name: Upload AppImage Artifacts
uses: actions/upload-artifact@v4
with:
name: ghostty-appimage-${{ matrix.arch }}
retention-days: 7
path: dist
tag:
name: "馃懟 Tip Tag"
if: ${{ github.event_name == 'schedule' && github.ref_name == 'main' }}
permissions:
actions: read
security-events: write
contents: write
runs-on: ubuntu-latest
needs:
- build_appimage
steps:
- uses: actions/checkout@v7 # zizmor: ignore[artipacked]
- name: Update 'tip' release
env:
GH_TOKEN: ${{ github.token }}
run: ./bin/repo-management.sh tag-tip
release_stable:
name: 馃懟 Release Ghostty AppImage (Stable)
if: >-
${{
(github.event_name == 'push' && github.ref_name == 'main')
|| github.event_name == 'release'
|| (github.event_name == 'workflow_dispatch' && inputs.publish)
}}
needs:
- build_appimage
permissions:
actions: read
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Resolve release tag
id: release
env:
EVENT_NAME: ${{ github.event_name }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
INPUT_TAG: ${{ inputs.tag }}
run: |
set -eu
tag="$(./bin/repo-management.sh resolve-tag)"
if [ -n "${tag}" ]; then
echo "tag=${tag}" >> "${GITHUB_OUTPUT}"
fi
- uses: actions/download-artifact@v6
if: steps.release.outputs.tag != ''
with:
name: ghostty-appimage-aarch64
- uses: actions/download-artifact@v6
if: steps.release.outputs.tag != ''
with:
name: ghostty-appimage-x86_64
- name: Publish release
if: steps.release.outputs.tag != ''
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ steps.release.outputs.tag }}
run: ./bin/repo-management.sh publish "${TAG}"
release_nightly:
name: 馃懟 Release Ghostty AppImage (Nightly)
if: ${{ github.event_name == 'schedule' && github.ref_name == 'main' }}
needs:
- build_appimage
- tag
permissions:
actions: read
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/download-artifact@v6
with:
name: ghostty-appimage-aarch64
- uses: actions/download-artifact@v6
with:
name: ghostty-appimage-x86_64
- name: Ghostty Tip ("Nightly")
env:
GH_TOKEN: ${{ github.token }}
run: ./bin/repo-management.sh publish-tip
create_release_pr:
name: "馃懟 Upstream Stable Release"
if: ${{ github.event_name == 'schedule' && github.ref_name == 'main' }}
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7 # zizmor: ignore[artipacked]
with:
fetch-depth: 0
- name: Detect upstream stable release
id: detect
run: |
set -eu
if version="$(./bin/repo-management.sh detect)"; then
echo "New upstream stable release: ${version}"
echo "release=true" >> "${GITHUB_OUTPUT}"
echo "version=${version}" >> "${GITHUB_OUTPUT}"
else
echo "No new upstream stable release"
echo "release=false" >> "${GITHUB_OUTPUT}"
fi
- name: Open release pull request
if: ${{ steps.detect.outputs.release == 'true' }}
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ steps.detect.outputs.version }}
run: ./bin/repo-management.sh open-pr "${VERSION}"
lint:
name: 馃Ч pre-commit
if: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
id: python
with:
python-version: "3.x"
- name: Cache pre-commit environments
uses: actions/cache@v6
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
pre-commit-${{ runner.os }}-${{ steps.python.outputs.python-version }}-
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: ./bin/repo-management.sh lint