Skip to content

Commit

Permalink
Fix tag formatting. (#1512)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvc94ch authored Feb 7, 2025
1 parent 65940ef commit 08502f7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/merge-srtool-runtime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,19 @@ on:
push:
branches:
- "ci/runtime/**"

env:
TC_CLI_IMAGE: analoglabs/tc-cli

jobs:

set-tags:
name: Get & set tags
runs-on: ubuntu-latest
outputs:
commit_hash: ${{ steps.get-sha.outputs.sha }}
commit_hash8: ${{ steps.get-sha.outputs.sha8 }}
tc_cli: ${{ steps.check-image.outputs.image }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -51,6 +57,19 @@ jobs:
echo "sha=$sha" >> $GITHUB_OUTPUT
echo "sha8=$(git log -1 --format='%H' | cut -c1-8)" >> $GITHUB_OUTPUT
echo "SHA commit:" $sha
- name: Check tc-cli image
id: check-image
run: |
TAG=${{ github.event.inputs.version || 'latest' }}
IMAGE="$TC_CLI_IMAGE:${TAG:0:8}"
echo "Checking if the image $IMAGE exists..."
if ! docker pull "$IMAGE" &>/dev/null; then
echo "Error: Image $IMAGE does not exist or is behind a private repo."
exit 1
fi
echo "Image $IMAGE exists. Proceeding with deployment..."
echo "IMAGE=$IMAGE" >> $GITHUB_OUTPUT
build-runtime:
name: Build runtimes
needs: ["set-tags"]
Expand Down Expand Up @@ -120,7 +139,7 @@ jobs:
-v ./development-runtime.wasm:/etc/development-runtime.wasm \
-e TIMECHAIN_MNEMONIC="${{ secrets.TIMECHAIN_MNEMONIC }}" \
-e TARGET_MNEMONIC="${{ secrets.TARGET_MNEMONIC }}" \
analoglabs/tc-cli:${{ github.event.inputs.version || 'latest' }} \
${{ needs.set_tags.outputs.tc_cli }} \
--config /etc/config.yaml runtime-upgrade /etc/development-runtime.wasm
- name: Notify on slack
Expand Down
2 changes: 1 addition & 1 deletion slack-bot/src/slack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl SlackState {
&info.commit[..8],
info.command.branch(),
info.command.tag()
.map(|tag| format!("\n\n*Version*\n`{}`", tag)).unwrap_or_default()
.map(|tag| format!("\n\n*Version*\n`{}`", &tag[..8])).unwrap_or_default()
))
.into(),
],
Expand Down

0 comments on commit 08502f7

Please sign in to comment.