From 8da0ec266cb4b05dd7180c074ff3aa63f7f6e8e6 Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Sat, 12 Mar 2022 16:37:10 +0000 Subject: [PATCH] Add release steps to README --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index a6699d2..8a65fda 100644 --- a/README.md +++ a/README.md @@ -41,6 +41,25 @@ (or add the corresponding [environment variable][envvar]) +To release your package from CI, add a new pipeline step: + +``` +stage: + - release-crate + +release-crate: + stage: release-crate + before_script: + - cargo install cargo-get + - export CRATE_NAME=$(cargo get name) CRATE_VERSION=$(cargo get version) + - export CRATE_FILE=$(CRATE_NAME)-$(CRATE_FILE).crate + script: + - cargo package + - cargo metadata > metadata.json + - curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file target/package/${CRATE_FILE} "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${NAME}/${VERSION}/${CRATE_FILE}" + - curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file metadata.json "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${NAME}/${VERSION}/metadata.json" +``` + It's that easy. Go forth and enjoy your newfound quality of life improvements, Rustacean. -- rgit 0.1.3