Skip to content

Commit

Permalink
ci: Fix tag name when published from UI
Browse files Browse the repository at this point in the history
Signed-off-by: Siddharth Chandrasekaran <[email protected]>
  • Loading branch information
sidcha committed Mar 9, 2024
1 parent 5bc567e commit 6fef1ae
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/publish-crate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
- 'osdpctl-v*'
workflow_dispatch:
inputs:
tags:
tag:
description: 'Tag'
required: true

Expand All @@ -30,7 +30,17 @@ jobs:
with:
toolchain: stable
override: true
- run: cargo publish --token ${CRATES_TOKEN} -p $(echo ${REL_TAG} | perl -pe 's/([a-z\-]+)-v.*/\1/')
- name: "Setup environment"
run: |
if [[ ${REL_TAG} == "master" ]]; then
echo "TAG=${TRIGGER_TAG}" >> "${GITHUB_ENV}"
else
echo "TAG=${REL_TAG}" >> "${GITHUB_ENV}"
fi
- name: "Publish crate ${TAG}"
run: |
cargo publish --token ${CRATES_TOKEN} -p $(echo ${TAG} | perl -pe 's/([a-z\-]+)-v.*/\1/')
env:
CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
REL_TAG: ${{ github.ref_name }}
TRIGGER_TAG: ${{ github.event.inputs.tag }}

0 comments on commit 6fef1ae

Please sign in to comment.