forked from wezterm/wezterm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathturtle-term-native-linux-packages.yml
More file actions
184 lines (167 loc) · 7.27 KB
/
Copy pathturtle-term-native-linux-packages.yml
File metadata and controls
184 lines (167 loc) · 7.27 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
name: TurtleTerm Native Linux Packages
on:
push:
tags:
- 'turtle-term-v*'
workflow_dispatch:
inputs:
version:
description: 'Package version without prefix, for example 0.1.0-dev'
required: false
default: '0.1.0-dev'
permissions:
contents: write
id-token: write
attestations: write
artifact-metadata: write
jobs:
build-native-linux-packages:
name: Build native Linux packages on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
deb_arch: amd64
rpm_arch: x86_64
arch_arch: x86_64
- os: ubuntu-24.04-arm
deb_arch: arm64
rpm_arch: aarch64
arch_arch: aarch64
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Resolve package version
id: version
shell: bash
env:
INPUT_VERSION: ${{ github.event.inputs.version }}
run: |
if [[ "${GITHUB_REF:-}" == refs/tags/turtle-term-v* ]]; then
version="${GITHUB_REF_NAME#turtle-term-v}"
else
version="${INPUT_VERSION:-0.1.0-dev}"
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install Linux build and package dependencies
run: |
sudo apt-get update -q
CI=yes ./get-deps
sudo apt-get install -y --no-install-recommends \
cpio desktop-file-utils dpkg-dev rpm zstd
- name: Build TurtleTerm runtime binaries
run: |
cargo build --release --locked -p wezterm
cargo build --release --locked -p wezterm-gui
cargo build --release --locked -p wezterm-mux-server
- name: Run TurtleTerm smoke tests
run: |
python3 assets/sourceos/tests/test_sourceos_term_smoke.py
python3 assets/sourceos/tests/test_turtle_product_identity.py
python3 assets/sourceos/tests/test_turtle_linux_desktop_identity.py
- name: Build Debian package
env:
TURTLE_TERM_VERSION: ${{ steps.version.outputs.version }}
TURTLE_TERM_DEB_ARCH: ${{ matrix.deb_arch }}
TURTLE_TERM_OUT_DIR: ${{ github.workspace }}/dist/native
run: bash packaging/scripts/build-deb-package.sh
- name: Build RPM package
env:
TURTLE_TERM_VERSION: ${{ steps.version.outputs.version }}
TURTLE_TERM_RPM_ARCH: ${{ matrix.rpm_arch }}
TURTLE_TERM_OUT_DIR: ${{ github.workspace }}/dist/native
run: bash packaging/scripts/build-rpm-package.sh
- name: Build Arch package
env:
TURTLE_TERM_VERSION: ${{ steps.version.outputs.version }}
TURTLE_TERM_ARCH_ARCH: ${{ matrix.arch_arch }}
TURTLE_TERM_OUT_DIR: ${{ github.workspace }}/dist/native
run: bash packaging/scripts/build-arch-package.sh
- name: Verify package artifacts exist
run: |
ls -lah dist/native
test -n "$(find dist/native -name 'turtle-term_*.deb' -print -quit)"
test -n "$(find dist/native -name 'turtle-term_*.deb.sha256' -print -quit)"
test -n "$(find dist/native -name 'turtle-term_*.deb.manifest.json' -print -quit)"
test -n "$(find dist/native -name 'turtle-term-*.rpm' -print -quit)"
test -n "$(find dist/native -name 'turtle-term-*.rpm.sha256' -print -quit)"
test -n "$(find dist/native -name 'turtle-term-*.rpm.manifest.json' -print -quit)"
test -n "$(find dist/native -name 'turtle-term-*.pkg.tar.zst' -print -quit)"
test -n "$(find dist/native -name 'turtle-term-*.pkg.tar.zst.sha256' -print -quit)"
test -n "$(find dist/native -name 'turtle-term-*.pkg.tar.zst.manifest.json' -print -quit)"
- name: Write native package index
env:
PACKAGE_VERSION: ${{ steps.version.outputs.version }}
run: |
python3 - <<'PY'
import json, os
from pathlib import Path
root = Path('dist/native')
packages = []
for path in sorted(root.rglob('*.manifest.json')):
data = json.loads(path.read_text())
if data.get('schema') == 'sourceos.turtle-term.native-package.manifest.v0':
packages.append(data)
if not packages:
raise SystemExit('no native package manifests found')
index = {
'schema': 'sourceos.turtle-term.native-package.index.v0',
'product': 'TurtleTerm',
'version': os.environ['PACKAGE_VERSION'],
'package_count': len(packages),
'packages': packages,
}
Path('dist/native/turtle-term-native-packages.index.json').write_text(json.dumps(index, indent=2, sort_keys=True) + '\n')
PY
sha256sum dist/native/turtle-term-native-packages.index.json > dist/native/turtle-term-native-packages.index.json.sha256
- name: Attest native Linux package artifacts
uses: actions/attest@v4
with:
subject-path: |
dist/native/turtle-term_*.deb
dist/native/turtle-term_*.deb.sha256
dist/native/turtle-term_*.deb.manifest.json
dist/native/rpmbuild/RPMS/**/*.rpm
dist/native/rpmbuild/RPMS/**/*.rpm.sha256
dist/native/rpmbuild/RPMS/**/*.rpm.manifest.json
dist/native/turtle-term-*.pkg.tar.zst
dist/native/turtle-term-*.pkg.tar.zst.sha256
dist/native/turtle-term-*.pkg.tar.zst.manifest.json
dist/native/turtle-term-native-packages.index.json
dist/native/turtle-term-native-packages.index.json.sha256
- name: Upload native package artifacts
uses: actions/upload-artifact@v4
with:
name: turtle-term-native-linux-${{ matrix.deb_arch }}
path: |
dist/native/turtle-term_*.deb
dist/native/turtle-term_*.deb.sha256
dist/native/turtle-term_*.deb.manifest.json
dist/native/rpmbuild/RPMS/**/*.rpm
dist/native/rpmbuild/RPMS/**/*.rpm.sha256
dist/native/rpmbuild/RPMS/**/*.rpm.manifest.json
dist/native/turtle-term-*.pkg.tar.zst
dist/native/turtle-term-*.pkg.tar.zst.sha256
dist/native/turtle-term-*.pkg.tar.zst.manifest.json
dist/native/turtle-term-native-packages.index.json
dist/native/turtle-term-native-packages.index.json.sha256
- name: Publish native packages to GitHub release
if: startsWith(github.ref, 'refs/tags/turtle-term-v')
uses: softprops/action-gh-release@v2
with:
files: |
dist/native/turtle-term_*.deb
dist/native/turtle-term_*.deb.sha256
dist/native/turtle-term_*.deb.manifest.json
dist/native/rpmbuild/RPMS/**/*.rpm
dist/native/rpmbuild/RPMS/**/*.rpm.sha256
dist/native/rpmbuild/RPMS/**/*.rpm.manifest.json
dist/native/turtle-term-*.pkg.tar.zst
dist/native/turtle-term-*.pkg.tar.zst.sha256
dist/native/turtle-term-*.pkg.tar.zst.manifest.json
dist/native/turtle-term-native-packages.index.json
dist/native/turtle-term-native-packages.index.json.sha256