From 533c1bbb759ddc3cb9458dcc3abd474023e525d8 Mon Sep 17 00:00:00 2001 From: Dave McKay Date: Fri, 15 Nov 2024 14:56:52 +0000 Subject: [PATCH] Create bm_version.yml --- .github/workflows/bm_version.yml | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/bm_version.yml diff --git a/.github/workflows/bm_version.yml b/.github/workflows/bm_version.yml new file mode 100644 index 0000000..eb22f04 --- /dev/null +++ b/.github/workflows/bm_version.yml @@ -0,0 +1,33 @@ +name: bm version CI + +on: + push: + paths: + - bucket_manager/** + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: get bm version + run: | + grep "version" csd3-echo-somerville/setup.py | awk -F\' '{print $2}' | awk -F\- '{print $1}' > version.txt + - name: set bm version + run: | + bm_version=$(cat version.txt) + git_hash=$(git rev-parse --short "$GITHUB_SHA") + sed -i "s/version.*/version='${bm_version}-dev-${git_hash}'/" csd3-echo-somerville/setup.py + - name: commit bm version CI + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + + git add csd3-echo-somerville/setup.py + git commit -m "bm version: updated to ${bm_version}-dev-${git_hash}" + - name: push bm version CI + run: | + git push