summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2024-02-12 11:49:01 +0200
committerLars Wirzenius <liw@liw.fi>2024-02-12 11:49:01 +0200
commit54a970925bdd6c23e489345aab269879f83271c6 (patch)
tree4a5bf599c9ef2b42053523a021a84943c5c572f1
parent02521e77a19bde1c7608e70a535d06cfe6ef348b (diff)
downloadliw-dot-files-54a970925bdd6c23e489345aab269879f83271c6.tar.gz
ambient.yaml: rework to build .deb of radicle-native-ci
Signed-off-by: Lars Wirzenius <liw@liw.fi> Sponsored-by: author
-rw-r--r--ambient.yaml62
1 files changed, 55 insertions, 7 deletions
diff --git a/ambient.yaml b/ambient.yaml
index ae5c944..26d427f 100644
--- a/ambient.yaml
+++ b/ambient.yaml
@@ -468,17 +468,34 @@ projects:
radicle-native-ci:
image: ~/tmp/ambient/ambient-boot.qcow2
source: ~/radicle/radicle-native-ci
- # pre_plan:
- # - action: cargo_fetch
+ pre_plan:
+ - action: cargo_fetch
plan:
- - action: rustup_setup
- - action: cargo_fmt
+# - action: rustup_setup
+# - action: cargo_fmt
# - action: cargo_clippy
- - action: cargo_build
- - action: cargo_test
+# - action: cargo_build
+# - action: cargo_test
- action: shell
shell: |
+
+ # FIXME: Put this in the Ambient `deb` action.
+
export PATH="/root/.cargo/bin:$PATH"
+ export CARGO_HOME=/workspace/deps
+ mkdir /workspace/cargo
+ export CARGO_TARGET_DIR=/workspace/cargo
+ export DEBEMAIL=liw@liw.fi
+ export DEBFULLNAME="Lars Wirzenius"
+ env
+
+ command -v cargo
+ command -v rustc
+
+ cargo --version
+ rustc --version
+
+ cargo check --offline
git status --ignored
git clean -fdx
@@ -488,7 +505,38 @@ projects:
version="$V.ci$T-1"
dch -v "$version" "CI build under Ambient."
dch -r ''
- - action: deb
+
+ # Get name and version of source package.
+ name="$(dpkg-parsechangelog -SSource)"
+ version="$(dpkg-parsechangelog -SVersion)"
+
+ # Get upstream version: everything before the last dash.
+ uv="$(echo "$version" | sed 's/-[^-]*$//')"
+ orig="${name}_${uv}.orig.tar.xz"
+
+ # Create a tar ball without the Debian packaging.
+ tmp="$(mktemp -d)"
+ trap 'rm -rf "$tmp"' EXIT
+ git archive HEAD | tar -C "$tmp" -xf -
+ rm -rf "$tmp/debian"
+ tar -C "$tmp" -cf - . | xz >"../$orig"
+
+ # Actually build the package, without signing the .changes file.
+ dpkg-buildpackage -us -uc
+
+ # Dump some information to make it easier to visually verify
+ # everything looks OK. Also, test the package with the lintian tool.
+ arch="$(dpkg --print-architecture)"
+ deb="../${name}_${version}_${arch}.deb"
+ changes="../${name}_${version}_${arch}.changes"
+
+ ls -l "$deb"
+ dpkg -c "$deb"
+ lintian -i "$changes"
+
+ mv ../*_* /workspace/artifacts
+
+# - action: deb
post_plan:
- action: dput