Skip to content

Commit

Permalink
[FIX] allow tags/releases from main branch
Browse files Browse the repository at this point in the history
Set fixed env.BRANCH_NAME to main.

Relates: #3995
  • Loading branch information
dkd-kaehm committed Oct 7, 2024
1 parent 3bd453d commit 26e38f8
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ env:
TESTING_SOLR_PORT: 8983
LOCAL_VOLUME_NAME: 'solrci-volume'
LOCAL_VOLUME_PATH: '/home/runner/work/ext-solr/ext-solr/.Build/data-solr'
BRANCH_NAME: 'main'

jobs:
ci_bootstrapping:
Expand All @@ -46,28 +47,6 @@ jobs:
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
uses: actions/checkout@v4
# End: Workaround for issue with actions/checkout...
-
name: "Resolve target branch of pull request."
if: github.event_name == 'pull_request'
run: |
echo "BRANCH_NAME=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV
-
name: "Resolve branch name on push in branch of repository."
if: ${{ !startsWith(github.ref, 'refs/tags/') && (github.event_name == 'push' || github.event_name == 'schedule') }}
run: |
echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
-
# We want to pass tests before the tag/release can be pushed to TER.
# This step resolves the branch name of the tag to use, to be able to collect proper build matrix values.
name: "Resolve branch name on release/tag in branch of repository."
if: startsWith(github.ref, 'refs/tags/')
# //[!0-9]/ in script below removes possible "v" prefix from major part,
# to prevent errors or make it possible to create tags with "v" or other prefixes.
run: |
export RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}
export MAJOR_MINOR_VERSIONS_STRING=$(v=( ${RELEASE_VERSION//./ } ) && echo "${v[0]//[!0-9]/}.${v[1]}")
export BRANCH_NAME=release-"$MAJOR_MINOR_VERSIONS_STRING".x
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
-
name: Collect build matrix
id: collect_build_matrix
Expand Down Expand Up @@ -110,7 +89,7 @@ jobs:
needs: ci_bootstrapping
continue-on-error: ${{ contains(matrix.TYPO3, '-dev') }}
strategy:
matrix: ${{fromJson(needs.ci_bootstrapping.outputs.matrix)}}
matrix: ${{ fromJson(needs.ci_bootstrapping.outputs.matrix) }}
env:
TYPO3_DATABASE_NAME: 'typo3_ci'
TYPO3_DATABASE_HOST: '127.0.0.1'
Expand Down

0 comments on commit 26e38f8

Please sign in to comment.