From 1885b481c9c7dd259cf8f6cb3125b0e085890fe5 Mon Sep 17 00:00:00 2001 From: Neshura Date: Mon, 18 Dec 2023 07:51:22 +0000 Subject: [PATCH] Add Version Check to Release Actions --- .forgejo/workflows/build+release.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.forgejo/workflows/build+release.yml b/.forgejo/workflows/build+release.yml index cc0a137..170b065 100644 --- a/.forgejo/workflows/build+release.yml +++ b/.forgejo/workflows/build+release.yml @@ -10,9 +10,22 @@ jobs: run-tests: runs-on: docker steps: + - + name: Checking Out Repository Code + uses: https://code.forgejo.org/actions/checkout@v3 - name: Placeholder run: echo Placeholder Job + - + name: Check if Version in Cargo.toml matches Tag + run: | + VERSION=$(cat Cargo.toml | grep -E "(^|\|)version =" | cut -f2- -d= | tr -d \" | tr -d " ") + if test $VERSION != "${{ github.ref_name }}"; then + echo "Expected Version is: '${{ github.ref_name }}' actual Version is: '$VERSION'"; + exit 1 + else + echo "Version is: '$VERSION'"; + fi build: needs: test