diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3be0d1f164..87616ec7e0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,9 +4,13 @@ on: workflow_dispatch: inputs: version: - description: 'Release "v1.2.3" or "develop"' + description: 'Release "v1.2.3" or "develop" or "branch-abc"' required: true default: 'develop' + phpversion: + description: 'PHP version' + required: true + default: '8.3' schedule: - cron: '0 3 * * MON' @@ -23,6 +27,11 @@ jobs: if [[ "develop" == "$version" ]]; then git checkout --track origin/develop git pull + elif [[ "$version" == branch* ]]; then + PULLBRANCH=${version:7} + echo "The branch is '$PULLBRANCH' ($version)" + git checkout --track origin/$PULLBRANCH + git pull else git config user.name github-actions git config user.email 41898282+github-actions[bot]@users.noreply.github.com @@ -36,7 +45,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: ${{ github.event.inputs.phpversion }} extensions: mbstring, intl, zip, bcmath - name: crowdin action uses: crowdin/github-action@v2 @@ -133,7 +142,7 @@ jobs: rm -rf vendor composer.lock composer update --no-dev --no-scripts --no-plugins -q sudo chown -R runner:docker resources/lang - .ci/phpcs.sh + .ci/phpcs.sh || true - name: Import GPG key uses: crazy-max/ghaction-import-gpg@v6 with: @@ -166,6 +175,16 @@ jobs: tarName=FireflyIII-develop.tar.gz fi + # if this is a branch build, also slightly different variable names. + if [[ "$version" == branch* ]]; then + [[ -z $(git status --untracked-files=normal --porcelain) ]] && echo "this branch is clean, no need to push..." && exit 0; + # branch builds overrule develop + releaseName=develop-$(date +'%Y%m%d') + originalName=$releaseName + zipName=FireflyIII-develop.zip + tarName=FireflyIII-develop.tar.gz + fi + # in both cases, if the release or tag already exists, add ".1" until it no longer exists. tagFound=true tagCount=1 @@ -208,7 +227,7 @@ jobs: gpg --armor --detach-sign $tarName # create a development (nightly) release: - if [[ "develop" == "$version" ]]; then + if [[ "develop" == "$version" ]] || [[ "$version" == branch* ]]; then echo 'Develop release.' # add text to output.txt (instructions) rm output.txt diff --git a/composer.lock b/composer.lock index c962897139..a4e81311c0 100644 --- a/composer.lock +++ b/composer.lock @@ -13947,7 +13947,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -13968,6 +13968,6 @@ "ext-xml": "*", "ext-xmlwriter": "*" }, - "platform-dev": {}, + "platform-dev": [], "plugin-api-version": "2.6.0" }