🏡 index : ~doyle/gitlab-cargo-shim.git

author Jordan Doyle <jordan@doyle.la> 2022-03-12 16:37:10.0 +00:00:00
committer Jordan Doyle <jordan@doyle.la> 2022-03-12 16:37:10.0 +00:00:00
commit
8da0ec266cb4b05dd7180c074ff3aa63f7f6e8e6 [patch]
tree
0485c116fa3a549372285b2422d76c888da778b6
parent
be1de75e63d5737228ee2435132ccf1fadd15959
download
8da0ec266cb4b05dd7180c074ff3aa63f7f6e8e6.tar.gz

Add release steps to README



Diff

 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.