]> xenbits.xensource.com Git - xen-guest-agent.git/commitdiff
ci: add source-tarball generation
authorYann Dirson <yann.dirson@vates.fr>
Mon, 11 Dec 2023 16:49:45 +0000 (17:49 +0100)
committerYann Dirson <yann.dirson@vates.fr>
Thu, 14 Dec 2023 08:47:45 +0000 (09:47 +0100)
Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
.gitlab-ci.yml
doc/release.md

index ed4fc2e85f31eb14b15db195044af23d9bf53793..96b5c540e983539b02d78be5050fd50bc2a489a0 100644 (file)
@@ -159,6 +159,19 @@ build-latest-linux:
     # show which dependencies changed in Cargo.lock
     - git diff
 
+## source packaging
+
+pkg-source:
+  stage: package
+  image: ${LINUX_RUSTIMG}
+  script:
+    - cargo package --no-verify
+    - CRATEFILE=$(basename target/package/xen-guest-agent-*.crate)
+    - mv target/package/${CRATEFILE} target/package/${CRATEFILE%.crate}.tar.gz
+  artifacts:
+    paths:
+      - target/package/*.tar.gz
+
 ## packaging from binary artifacts
 
 pkg-deb-amd64:
index 9876f246d6390e1c61c8727cacdda4d5febb1649..78b676ce6c20cf58ac4c40a53e0af5cdb1d593ad 100644 (file)
@@ -3,8 +3,8 @@
 This describes:
 
 - the manual steps to release a new version
-- the explanation of how the Gitlab CI jobs producing binaries work,
-  and how to reproduce the locally if needed
+- the explanation of how the Gitlab CI jobs producing build artifacts
+  works, and how to reproduce the locally if needed
 
 These instructions assume you replace `$VERSION` with the actual
 version being released.
@@ -23,11 +23,15 @@ operations:
 - run `cargo tree` (or any cargo command updating the version in `Cargo.lock`
 - `git commit Cargo.toml Cargo.lock -m "Release $VERSION"`
 - `git tag $VERSION -m $VERSION`
-- `cargo package`
-- `mv target/package/xen-guest-agent-$VERSION.crate ../xen-guest-agent-$VERSION.tar.gz`
 - update version in Cargo.toml to $NEXTVERSION-dev
 - create new entry for $NEXTVERSION in `CHANGELOG.md`
 
+### source tarball
+
+The tarball itself is created by the CI from the tagged version, using
+`cargo package`.  The generated `.crate` file is indeed a standard
+gzipped source tarball.
+
 ## binary artifacts
 
 outputs: