File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : release
1+ name : release-beta
22
33on :
44 workflow_run :
5- workflows : ["tests", "linter" ]
5+ workflows : ["tests"]
66 types : [completed]
7- pull_request :
8- branches : ["master"]
9-
10- permissions :
11- contents : write
127
138jobs :
149 release :
15- if : github.event.pull_request.merged == true
10+ if : ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'beta' }}
1611 runs-on : ubuntu-latest
1712 steps :
1813 - name : Checkout
@@ -30,11 +25,15 @@ jobs:
3025 id : version
3126 run : |
3227 VERSION=$(php -r "echo trim(file_get_contents('VERSION'));")
33- echo "Detected version: $VERSION"
34-
35- if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9\.]+)?$ ]]; then
36- echo "Invalid version format in VERSION file: $VERSION"
37- exit 1
28+ echo "version=$VERSION" >> $GITHUB_OUTPUT
29+ EXISTING=$(git tag | grep -E "^v${VERSION}-beta\.[0-9]+$" | sort -V | tail -n 1 || true)
30+
31+ if [ -z "$EXISTING" ]; then
32+ NEW_TAG="v${VERSION}-beta.1"
33+ else
34+ LAST_NUM=$(echo "$EXISTING" | sed -E 's/^v[0-9]+\.[0-9]+\.[0-9]+-beta\.([0-9]+)$/\1/')
35+ NEXT_NUM=$((LAST_NUM + 1))
36+ NEW_TAG="v${VERSION}-beta.${NEXT_NUM}"
3837 fi
3938 echo "version=$VERSION" >> $GITHUB_OUTPUT
4039
@@ -108,6 +107,6 @@ jobs:
108107 dployr-v${{ steps.version.outputs.version }}.zip
109108 LICENSE
110109 generate_release_notes : true
110+ make_latest : false
111111 env :
112112 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
113-
You can’t perform that action at this time.
0 commit comments