From 4a69e22c8cc9bad50d942d32f359a35e5bc714ad Mon Sep 17 00:00:00 2001 From: Jan Wille Date: Thu, 9 Mar 2023 12:06:44 +0100 Subject: [PATCH] deploy-action should now work should now be independen of branch and allow for releases from branches other than master --- .github/workflows/publish.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 1ddc091..e23359a 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -19,7 +19,11 @@ jobs: - name: Checkout uses: actions/checkout@v3 with: - ref: master + fetch-depth: 0 + - name: Set env + run: | + echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + echo "BRANCH=$(git branch -r --contains ${GITHUB_REF} | grep -v HEAD | sed -n 's/ *origin\/\(.*\)/\1/p')" >> $GITHUB_ENV - name: Set up Python uses: actions/setup-python@v4 with: @@ -30,7 +34,7 @@ jobs: pip install setuptools wheel twine - name: get infos from Tag run: | - if [[ $GITHUB_REF =~ (([0-9]+)\.([0-9]+)\.([0-9]+))([-./]dev([0-9]+))? ]] + if [[ $RELEASE_TAG =~ (([0-9]+)\.([0-9]+)\.([0-9]+))([-./]dev([0-9]+))? ]] then echo "VERSION=${BASH_REMATCH[0]}" >> $GITHUB_ENV echo "VERSION_MAJOR=${BASH_REMATCH[2]}" >> $GITHUB_ENV @@ -72,4 +76,6 @@ jobs: - name: commit new version-number uses: stefanzweifel/git-auto-commit-action@v4 with: + branch: ${{ env.BRANCH }} + create_branch: true commit_message: "increment version after release"