Skip to content

Commit e2f96b4

Browse files
authored
Merge pull request #111 from appleparan/appleparan/fix-launchpad-build
fix: add cargo vendor step for Launchpad offline builds
2 parents d18cee1 + 0fb6435 commit e2f96b4

File tree

3 files changed

+40
-7
lines changed

3 files changed

+40
-7
lines changed

.github/workflows/launchpad_ppa.yml

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,35 @@ jobs:
100100
GH_TOKEN: ${{ github.token }}
101101

102102
# ───────────────────────────────────────────────────────────────
103-
# Step 5: Install build dependencies
103+
# Step 5: Install Rust toolchain
104+
# ───────────────────────────────────────────────────────────────
105+
- name: Install Rust toolchain
106+
if: steps.check_distro.outputs.should_run == 'true'
107+
uses: dtolnay/rust-toolchain@stable
108+
109+
# ───────────────────────────────────────────────────────────────
110+
# Step 6: Vendor Rust dependencies
111+
# ───────────────────────────────────────────────────────────────
112+
- name: Vendor Rust dependencies
113+
if: steps.check_distro.outputs.should_run == 'true'
114+
run: |
115+
# Vendor all dependencies for offline Launchpad build
116+
cargo vendor debian/vendor
117+
118+
# Create .cargo/config.toml to use vendored sources
119+
mkdir -p .cargo
120+
cat > .cargo/config.toml << 'EOF'
121+
[source.crates-io]
122+
replace-with = "vendored-sources"
123+
124+
[source.vendored-sources]
125+
directory = "debian/vendor"
126+
EOF
127+
128+
echo "Vendored dependencies created ($(du -sh debian/vendor | cut -f1))"
129+
130+
# ───────────────────────────────────────────────────────────────
131+
# Step 7: Install build dependencies
104132
# ───────────────────────────────────────────────────────────────
105133
- name: Install build dependencies
106134
if: steps.check_distro.outputs.should_run == 'true'
@@ -122,7 +150,7 @@ jobs:
122150
libdrm-dev
123151
124152
# ───────────────────────────────────────────────────────────────────
125-
# Step 6: Prepare package version
153+
# Step 8: Prepare package version
126154
# ───────────────────────────────────────────────────────────────
127155
- name: Prepare package version
128156
if: steps.check_distro.outputs.should_run == 'true'
@@ -144,7 +172,7 @@ jobs:
144172
}
145173
146174
# ───────────────────────────────────────────────────────────────
147-
# Step 7: Import GPG signing key
175+
# Step 9: Import GPG signing key
148176
# ───────────────────────────────────────────────────────────────
149177
- name: Import GPG key
150178
if: steps.check_distro.outputs.should_run == 'true'
@@ -164,7 +192,7 @@ jobs:
164192
echo "${FINGERPRINT}:6:" | gpg --import-ownertrust
165193
166194
# ───────────────────────────────────────────────────────────────
167-
# Step 8: Configure GPG for non-interactive signing
195+
# Step 10: Configure GPG for non-interactive signing
168196
# ───────────────────────────────────────────────────────────────
169197
- name: Configure GPG
170198
if: steps.check_distro.outputs.should_run == 'true'
@@ -198,7 +226,7 @@ jobs:
198226
gpgconf --kill gpg-agent || true
199227
200228
# ───────────────────────────────────────────────────────────────
201-
# Step 9: Build source package
229+
# Step 11: Build source package
202230
# ───────────────────────────────────────────────────────────────
203231
- name: Build source package
204232
if: steps.check_distro.outputs.should_run == 'true'
@@ -240,7 +268,7 @@ jobs:
240268
echo "Source package built and signed successfully"
241269
242270
# ───────────────────────────────────────────────────────────────
243-
# Step 10: Upload to PPA
271+
# Step 12: Upload to PPA
244272
# ───────────────────────────────────────────────────────────────
245273
- name: Upload to Ubuntu PPA
246274
if: steps.check_distro.outputs.should_run == 'true'

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ Cargo.lock
1717
# Vendor directories
1818
/vendor/
1919
.vendor/
20+
/debian/vendor/
21+
22+
# Cargo config for vendored builds
23+
/.cargo/
2024

2125
# Test and temporary files
2226
*.csv

debian/source/include-binaries

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
debian/vendor
1+
debian/vendor
2+
.cargo/config.toml

0 commit comments

Comments
 (0)